题目链接: Problem - B - Codeforces
代码
#include<bits/stdc++.h>
using namespace std;
int T;
long long n;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> T;
while(T--)
{
long long n;
cin >> n;
int ans = 0;
for(int i = 1; i <= 100; i++)
if(n % i)
{
ans=i-1;
break;
}
cout << ans << '\n';
}
return 0;
}