newton/solutions/python/2009A.py

11 lines
230 B
Python
Raw Normal View History

2025-01-11 11:41:29 +00:00
t = int(input())
for _ in range(t):
a,b = [int(x) for x in input().split(" ")]
minimum = b
for c in range(a,b+1):
value = (c-a)+(b-c)
if value < minimum:
minimum = value
print(minimum)