fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int Calculation(int a){
  6. int count=0;
  7. for(int i=1; i<sqrt(a); i++){
  8. for(int j=1; j<sqrt(a); j++){
  9. if(((2*i) +(2*j) + (i*j)) == a){
  10. count = 1;
  11. return count;
  12. }
  13. }
  14. }
  15. return count = 0;
  16. }
  17.  
  18. int main() {
  19. int test;
  20. cin>>test;
  21. while(test--){
  22. int x;
  23. cin>>x;
  24. int counter = Calculation(x);
  25. if (counter == 1)
  26. {
  27. cout << "YES" << endl;
  28. }
  29. else
  30. {
  31. cout << "NO" << endl;
  32. }
  33. }
  34. return 0;
  35. }
Success #stdin #stdout 0.17s 5432KB
stdin
4
50
99
6666
88888888
stdout
YES
NO
NO
NO