#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, l, n, t;
  cin >> t;
  while (t--) {
    cin >> n;
    long long int ans = 0;
    if (n % 2 == 0)
      ans = n / 2;
    else {
      n = n - 3;
      ans = n / 2 + 1;
    }
    cout << ans << endl;
  }
  return 0;
}
