#include <bits/stdc++.h>
using namespace std;
int a[200], counter[200] = {0};
int supp[6] = {2, 3, 4, 5, 6, 7};
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) cin >> a[i];
  for (int i = 0; i < t; i++) {
    for (int j = 5; j >= 0; j--) {
      if (a[i] % supp[j] == 2) {
        counter[i] += ((a[i] / supp[j]) + 1);
        break;
      }
    }
    int k = 0;
    if (counter[i] == 0) {
      while (a[i] - supp[k] >= 0 && (k <= 5 && k >= 0)) {
        a[i] -= supp[k];
        counter[i]++;
      }
      if (k <= 5) k++;
    }
  }
  for (int i = 0; i < t; i++) cout << counter[i] << "\n";
}
