-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Elections.cpp
More file actions
37 lines (37 loc) · 900 Bytes
/
A_Elections.cpp
File metadata and controls
37 lines (37 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t; cin >> t;
while(t--){
int a, b, c;
cin >> a >> b >> c;
if(a == b and b == c and c == a){
cout << a + 1 << ' ' << b + 1 << ' ' << c + 1 << endl;
}
else{
int high = a;
high = max(high, b);
high = max(high, c);
if(a != high){
cout << (high - a) + 1 << ' ';
}
else{
cout << 0 << ' ';
}
if(b != high){
cout << (high - b) + 1 << ' ';
}
else{
cout << 0 << ' ';
}
if(high != c){
cout << (high - c) + 1 << endl;
}
else{
cout << 0 << endl;
}
}
}
return 0;
}