fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define int long long
  5. #define yes cout << "YES\n";
  6. #define no cout << "NO\n";
  7.  
  8.  
  9. void FastIO(){
  10. ios_base::sync_with_stdio(false);
  11. cin.tie(nullptr);
  12. cout.tie(nullptr);
  13. }
  14.  
  15. void solve(){
  16. int a,b,c;
  17. cin >> a >> b >> c;
  18.  
  19. double k = (double) (a+c) / 2;
  20. int checkA = 2*b - c, checkB = (a+c)/2, checkC = 2*b - a;
  21.  
  22. if((checkA > 0 && checkA%a == 0) || (k - (double) checkB == 0 && checkB%b == 0) || (checkC > 0 && checkC%c == 0))
  23. yes
  24.  
  25. else
  26. no
  27. }
  28.  
  29.  
  30. signed main(){
  31. FastIO();
  32.  
  33. int t = 1;
  34. cin >> t;
  35.  
  36. while (t--){
  37. solve();
  38. }
  39. return 0;
  40. }
  41.  
Success #stdin #stdout 0.01s 5300KB
stdin
11
10 5 30
30 5 10
1 2 3
1 6 3
2 6 3
1 1 1
1 1 2
1 1 3
1 100000000 1
2 1 1
1 2 2
stdout
YES
YES
YES
YES
NO
YES
NO
YES
YES
NO
YES