#include <iostream>
#include <vector>
#include <algorithm>
#include<math.h>
using namespace std;
vector<int> getDiv(int n) {
vector<int> div;
int limit=sqrt(n);
for (int i=2; i<=limit; i++) {
if (n % i == 0) {
div.push_back(i);
if (i!= n/i) {
div.push_back(n / i);
}
}
}
sort(div.begin(),div.end());
return div;
}
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> divisors = getDiv(n);
int maxPartitions = 1;
for (int i : divisors) {
int partitions = n / i;
if (partitions >= 1 && i >= 2) {
maxPartitions = max(maxPartitions, partitions);
}
}
cout << maxPartitions << endl;
}
return 0;
}