#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[6];
    int i, flag = 0;
    for (i = 0; i < 6; i++) {
      arr[i] = i + 2;
    }
    if (n > 1 && n < 8) {
      cout << "1" << endl;
    } else if (n == 1)
      cout << "0" << endl;
    else {
      int a = n / 7;
      if (n % 7 == 1)
        cout << a + 1 << endl;
      else if (n % 7 == 0)
        cout << a << endl;
      else
        cout << a + 1 << endl;
    }
  }
}
