arten_1337

Untitled

Apr 17th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. /*
  2.     Author - Arten
  3. */
  4.  
  5. #include <bits/stdc++.h>
  6.  
  7. using namespace std;
  8.  
  9. #define endl "\n"
  10. #define ll long long
  11. #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  12.  
  13. int main(){
  14.     IOS;
  15.     int t;
  16.     cin >> t;
  17.     while(t--){
  18.         ll n, count = 0;
  19.         cin >>n;
  20.         for(ll i = 1; i <= n; i = i + 2){
  21.             if(i % 2 == 0 || i % 3 == 0 || i % 5 == 0 || i % 7 == 0 || i % 11 == 0 || i % 13 == 0 || i % 17 == 0 || i % 19 == 0)
  22.                 count++;
  23.         }
  24.         cout << count+n/2 << endl;
  25.     }
  26.  
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment