#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ch = char;
string a;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int x;
    cin >> x;
    if (x < 8)
      cout << "1" << endl;
    else {
      if (x % 2 == 0)
        cout << x / 2 << endl;
      else
        cout << 1 + (x - 3) / 2 << endl;
    }
  }
  return 0;
}
