#include <iostream>
using namespace std;
long long t,n;
int main() {
cin >> t;
for(int k=1;k<=t;k++){
cin >> n;
if (n < 6) {
cout << -1 << endl;
continue;
}
long long limit = n / 6;
long long g_max = 1;
for (long long i = 1; i * i <= n; ++i) {
if (n % i == 0) {
if (i <= limit)g_max = max(g_max, i);
long long j = n / i;
if (j <= limit) {
g_max = max(g_max, j);
}
}
}
cout << g_max << endl;
}
return 0;
}
能运行,然后样例也对
玄关