Advertisement
dllbridge

Untitled

Nov 15th, 2022
865
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #define ll long long
  4.    
  5.                                            
  6.                                            
  7.  
  8. ll a,
  9.    b,
  10.    c[1000000];  
  11.  
  12.  
  13. int main()
  14. {
  15.     cin >> a;
  16.    
  17.  
  18.     for(int i = 1; i < 1000000; i += 2) c[i] = i;
  19.    
  20.    
  21.     for(int i = 0; i < a; i++)
  22.     {
  23.         cin >> b;
  24.        
  25.         for(int u = 1; u < b; u += 2)
  26.        
  27.         if(b % c[u])  cout << "NO"  << endl;
  28.                       else cout << "YES" << endl;
  29.                      
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement