#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 1, 0, 0, -1, 1, -1, 1};
int dy[] = {0, 0, -1, 1, -1, 1, 1, -1};
const int oo = 2e9;
const int N = 1e6;
int t[1000000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, ans = 0, x;
  cin >> n;
  while (n > 0) {
    ans = 0;
    cin >> x;
    x -= 2;
    while (x > 7) {
      x -= 7;
      ans++;
    }
    if (x + 2 > 7)
      ans += 2;
    else
      ans++;
    cout << ans << endl;
    n--;
  }
  return 0;
}
