Codechef•May 01, 2025
Discus Throw
Hazrat Ali
Codechef
Input Format
- First line will contain TT, number of test cases. Then the test cases follow.
- Each test case contains of a single line of input, three integers A,B,A,B, and CC denoting the distances in each throw.
Output Format
For each test case, output the final score of the player.
Constraints
- 1≤T≤100
- 1≤A,B,C≤100
Sample 1:
Input
3 10 15 8 32 32 32 82 45 54
Output
15 32 82
Solution
#include <stdio.h>
int main(void) {
int m;
scanf("%d",&m);
while(m--){
int x,y,z;
scanf("%d %d %d",&x,&y,&z);
if(x >= y){
if(x >= z)
printf("%d\n",x);
else printf("%d\n",z);
}
else{
if(y >= z)
printf("%d\n",y);
else printf("%d\n",z);
}
}
return 0;
}