fork(2) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define endl '\n'
  4. #define int long long
  5.  
  6. const int MOD = 1e9+7;
  7. const int INF = LLONG_MAX/2;
  8.  
  9. signed main() {
  10. ios::sync_with_stdio(false); cin.tie(NULL);
  11. int t;
  12. cin >> t;
  13. while(t--) {
  14. long long n;
  15. cin >>n;
  16. int i=1;
  17. while(n%i == 0)i++;
  18. cout<<i-1<<endl;
  19. }
  20. }
  21.  
Success #stdin #stdout 0s 5288KB
stdin
10
1
40
990990
4204474560
169958913706572972
365988220345828080
387701719537826430
620196883578129853
864802341280805662
1000000000000000000
stdout
1
2
3
6
4
22
3
1
2
2