-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1624B.cpp
More file actions
41 lines (31 loc) · 688 Bytes
/
Copy path1624B.cpp
File metadata and controls
41 lines (31 loc) · 688 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
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int a,b,c;
cin>>a>>b>>c;
bool ok = false;
int new_a = 2*b - c;
int new_c = 2*b - a;
if(new_a > 0 && new_a % a ==0){
ok = true;
}
if((a+c) %2==0){
int new_b = (a+c)/2;
if(new_b > 0 && new_b % b ==0){
ok = true;
}
}
if(new_c > 0 && new_c % c ==0){
ok = true;
}
if(ok){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
}