Help me in solving CANDYSTORE problem

My issue

Chef has started working at the candy store. The store has 100 chocolates in total.

Chef’s daily goal is to sell X chocolates. For each chocolate sold, he will get 1 rupee. However, if Chef exceeds his daily goal, he gets 2
rupees per chocolate for each extra chocolate.

If Chef sells Y chocolates in a day, find the total amount he made

My code

# cook your dish here
t = int(input())
x = int(input())
for i in range(t):

   if x >= i:
        print(i)
   else:
        print(2*i-x)

Learning course: Basic Math using Python
Problem Link: CodeChef: Practical coding for everyone

@aparnapdinesh
The logic is if x>=y then print y .
else case print x+(y-x)*2;

Wrong logic buddy.
if x>=y: print(y)
else: print(2*y-x)