Help me in solving CANDYSTORE problem

My issue

logic for above

My code

# cook your dish here
k = int(input())
for i in range(k):
    x,y = map(int,input().split())
    

Learning course: Basic Math using Python
Problem Link: Candy Store Practice Problem in - CodeChef

@rahul_1819
U have to do it like this

# cook your dish here
t = int(input())

for i in range(t):
    x,y = map(int,input().split())
    if x < y:
        print(x+(y-x)*2)
    else:
        print(y)