Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def s_a():
- t = int(input())
- arr = []
- for i in range(t):
- a, b = tuple([int(x) for x in input().split()])
- a1, b1 =(a, b)
- d = abs(a - b)
- if (d == 0):
- arr.append("0 0")
- elif (d == 1):
- arr.append("1 0")
- else:
- i = 0
- m = a % d
- if(m <= d//2):
- i = m
- else:
- i = d - m
- arr.append("{} {}".format(d,i))
- for el in arr:
- print(el)
- # s_a()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement