Help me in solving LB08 problem

My issue

this code give me wrong answer during submission what is wrong in my code?please help somebody

My code

t = int(input())
for i in range(t):
    N, M = map(int, input().split())
    if N<M:
        print(M-N)
    elif N>M:
        print(2*N-M)
# Update the code below to solve the problem

t = int(input())
for i in range(t):
    N, M = map(int, input().split())
    if N<M:
        print(M-N)
    elif N>M:
        print(2*N-M)
   

Learning course: Python for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone

@rehan_akhtar
U have done implementation mistakes.

# Update the code below to solve the problem

t = int(input())
for i in range(t):
    N, M = map(int, input().split())
    if M>=N:
        print(N)
    else:
        print(M+ (N-M)*2)
    
    ```
Refer this code