#include <iostream>
#include <cmath>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int N;
cin >> N;
int maxPartitions = 1; // Initialize with 1 partition
// Iterate from 2 to sqrt(N)
for (int i = 2; i * i <= N; i++) {
// Check if N is divisible by i
if (N % i == 0) {
int diff = N / i; // Calculate the difference for each subarray of length i
// Check if the difference is the same for all subarrays
if (N % diff == 0) {
maxPartitions = max(maxPartitions, N / diff);
}
}
}
cout << maxPartitions << endl;
}
return 0;
}