#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long ans;
  long long n;
  while (t--) {
    ans = 0;
    cin >> n;
    int i = 7;
    if (n % 7 == 1) {
      i--;
    }
    for (; i >= 2; i--) {
      ans += n / i;
      n = n % i;
    }
    cout << ans << endl;
  }
}
