#include <bits/stdc++.h>
using namespace std;
int n;
int a[101];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 0) {
      cout << a[i] / 2 << endl;
    } else {
      cout << (a[i] - 3) / 2 + 1 << endl;
    }
  }
}
