-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMEANMEDIAN.c
More file actions
34 lines (34 loc) · 769 Bytes
/
Copy pathMEANMEDIAN.c
File metadata and controls
34 lines (34 loc) · 769 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
#include<stdio.h>
int main(){
int t,x,y;
int a,b,c;
scanf("%d",&t);
for(int i=0;i<t;i++){
scanf("%d %d",&x,&y);
if(x==y){
printf("%d %d %d\n",x,x,x);
}
else{
b=y;
x=x*3;
c=x-b;
a=x-(b+c);
if(c>=b){
if(a>b){
printf("%d %d %d\n",a-(a-b),b,c+(a-b));
}
else{
printf("%d %d %d\n",a,b,c);
}
}
else{
if(a<b){
printf("%d %d %d\n",c-(b-a),b,a+(b-a));
}
else{
printf("%d %d %d\n",c,b,a);
}
}
}
}
}