-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1555.cpp
More file actions
36 lines (26 loc) · 702 Bytes
/
1555.cpp
File metadata and controls
36 lines (26 loc) · 702 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
#include <iostream>
using namespace std;
int rafaelFunction(int x, int y){
return ((3 * x) * (3 * x)) + (y * y);
}
int betoFunction(int x, int y){
return (2 * (x * x)) + ((5 * y) * (5 * y));
}
int carlosFunction(int x, int y){
return (y * y * y) - (100 * x);
}
int main(){
int qtd;
int x, y;
cin >> qtd;
for(int i=0; i<qtd; i++){
cin >> x >> y;
int r = rafaelFunction(x, y);
int b = betoFunction(x, y);
int c = carlosFunction(x, y);
if(r > b && r > c) cout << "Rafael ganhou" << endl;
if(b > r && b > c) cout << "Beto ganhou" << endl;
if(c > r && c > b) cout << "Carlos ganhou" << endl;
}
return 0;
}