-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
50 lines (49 loc) · 933 Bytes
/
A.cpp
File metadata and controls
50 lines (49 loc) · 933 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
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <stdio.h>
int main()
{
int t;
scanf("%d",&t);
for(int i = 0; i < t; i++){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
int A,B,C;
if(a>b && a>c){
A=0;
B=a-b+1;
C=a-c+1;
}
else if(b>a && b>c){
A=b-a+1;
B=0;
C=b-c+1;
}
else if(c>b && c>a)
{
A=c-a+1;
B=c-b+1;
C=0;
}
else if(a==b){
A=1;
B=1;
C=a-c+1;
}
else if(b==c){
A=b-a+1;
B=1;
C=1;
}
else if(c==a){
A=1;
B=a-b+1;
C=1;
}
else if(a==b && b==c){
A=1;
B=1;
C=1;
}
printf("%d %d %d\n",A,B,C);
}
return 0;
}