Advertisement
Georgiy1108

Untitled

Sep 29th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int count(long long x)
  6. {
  7.     long long k = 0;
  8.     long long i = 1;
  9.     for(; i * i < x; i++)
  10.     {
  11.         if(x % i == 0)
  12.             k += 2;
  13.     }
  14.     if(i * i == x)
  15.         k++;
  16.     return k;
  17. }
  18.  
  19. main()
  20. {
  21.     long long x;
  22.     cin >> x;
  23.     long long i = x;
  24.     long long c = 0;
  25.     long long p = 1.01 * x;
  26. //  cout << count(510510);
  27.     if(x > 100000000LL)
  28.     {
  29.         if(x % 2 == 1)
  30.             x++;
  31.         cout << x;
  32.         return 0;
  33.     }
  34.     while(true)
  35.     {
  36.         if(c > 10000)
  37.             break;
  38.         if(i > p)
  39.             break;
  40.         else
  41.         {
  42.             if(count(i) >= 100)
  43.                 cout << i, exit(0);
  44.         }
  45.         i++;
  46.         c++;
  47.     }
  48.     cout << -1;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement