#include <bits/stdc++.h>
const int mod = 1000000007;
using namespace std;
int prime(int n) {
  int isPrime = 1;
  if (n == 2) {
    return 1;
  }
  if (n % 2 == 0) return 0;
  for (int i = 3; i <= n / 2; i += 2) {
    if (n % i == 0) {
      isPrime = 0;
      break;
    }
  }
  if (isPrime) {
    return 1;
  } else {
    return 0;
  }
}
void testcase() {
  unsigned int n;
  cin >> n;
  if (n == 1 || n == 2 || n == 3) {
    cout << "1\n";
    return;
  } else {
    int pri = prime(n);
    if (pri == 1) {
      n = n - 1;
      unsigned int ans = n / 2;
      cout << ans << "\n";
      return;
    } else {
      unsigned int d = 2;
      for (unsigned int i = n; i > 1; i--) {
        if (i % d == 0) {
          unsigned int ans = i / 2;
          cout << ans << "\n";
          return;
        }
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    testcase();
  }
  return 0;
}
