문제풀이/SW Expert Academy

[SWEA][D3] 3431. 준환이의 운동관리 (파이썬/Python)

얄루몬 2021. 10. 11. 17:52

t = int(input())
for tc in range(1, t+1):
    
    l,u,x = map(int,input().split())
    if x > u:
        result = -1
    elif x < l :
        result = l-x
    elif x > l and x < u:
        result = 0
    print(f'#{tc} {result}')