#include <bits/stdc++.h>
using namespace std;
int ans;
bool ex = false;
void count(int x) {
  if (x == 0) {
    ex = true;
    return;
  }
  if (x == 1) {
    return;
  }
  for (int i = min(x, 7); i >= 2; i--) {
    ans++;
    count(x - i);
    if (ex) return;
    ans--;
  }
}
int main() {
  int t;
  cin >> t;
  int x;
  for (int i = 0; i < t; i++) {
    cin >> x;
    ans = 0;
    ex = false;
    count(x);
    cout << ans << endl;
  }
  return 0;
}
