- P115's solution
P115's Solution
- 2025-9-4 22:00:02 @
由 ,可知答案不大于 ,暴力即可。
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
while (T--)
{
int n;
cin >> n;
int ans = 2;
while (__gcd(ans, n) > 1) ans++;
cout << ans << endl;
}
return 0;
}