#include <bits/stdc++.h>
using namespace std;
void solve() {
  int x, c = 0;
  cin >> x;
  while (x > 0) {
    if (8 < x) {
      x -= 7;
      c++;
    } else if (x < 8) {
      c++;
      cout << c;
      return;
    } else {
      x -= 6;
      c++;
    }
  }
  cout << c;
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int q;
  cin >> q;
  while (q--) {
    solve();
    if (q != 0) cout << "\n";
  }
  return 0;
}
