#include <bits/stdc++.h>
using namespace std;
void calc(int k) {
  int a[] = {2, 3, 4, 5, 6, 7};
  int i = 5;
  int cnt = 0;
  if ((k > 1) && (k < 8)) {
    cnt = 1;
  } else {
    cnt = 1;
    for (; i > -1;) {
      int temp = k - a[i];
      if (temp > 7) {
        cnt++;
        k -= a[i];
      } else if ((temp > 1) && (temp < 8)) {
        cnt++;
        break;
      } else {
        i--;
      }
    }
  }
  cout << cnt << endl;
}
int main() {
  int t;
  cin >> t;
  vector<int> n(t);
  for (int i = 0; i < t; i++) {
    cin >> n[i];
  }
  for (int i = 0; i < t; i++) {
    calc(n[i]);
  }
  return 0;
}
