fork download
  1. from sys import stdin
  2. for _ in range(int(stdin.readline())):
  3. a, b, c = map(int, stdin.readline().split())
  4. d = max(a, b, c)
  5. if a == b == c:
  6. print(*[a + 1] * 3)
  7. else:
  8. print(d - a + 1 if a != d else 0,d - b + 1 if b != d else 0, d - c + 1 if c != d else 0)
Success #stdin #stdout 0.03s 9228KB
stdin
26
43 58 82 
72 82 85 
28 82 62 
45 88 45 
35 38 29 
47 59 45 
16 54 91 
86 19 75 
79 65 92 
62 54 39 
8 63 54 
37 76 7 
26 52 100 
82 23 76 
5 19 41 
17 32 77 
93 49 93 
19 11 36 
78 56 55 
67 29 37 
76 100 70 
21 40 86 
32 74 86 
93 65 83 
97 58 38 
4 81 21 
60 73 10
stdout
40 25 0
14 4 0
55 0 21
44 0 44
4 0 10
13 0 15
76 38 0
0 68 12
14 28 0
0 9 24
56 0 10
40 0 70
75 49 0
0 60 7
37 23 0
61 46 0
0 45 0
18 26 0
0 23 24
0 39 31
25 0 31
66 47 0
55 13 0
0 29 11
0 40 60
78 0 61