fork download
  1. def bandito(n,m,l,r):
  2. if n == m:
  3. print(l,r)
  4. return
  5. if(m <= r):
  6. print(0,m)
  7. return
  8. print(-(m-r), r)
  9.  
  10. def main():
  11. t = int(input())
  12. for i in range(t):
  13. n,m,l,r = map(int, input().split())
  14. bandito(n,m,l,r)
  15. main()
Success #stdin #stdout 0.07s 14028KB
stdin
4
4 2 -2 2
4 1 0 4
3 3 -1 2
9 8 -6 3
stdout
0 2
0 1
-1 2
-5 3