#include <bits/stdc++.h>
int main() {
  int total, query[100], i;
  int answer[100];
  scanf("%d", &total);
  for (i = 0; i < total; i++) {
    scanf("%d", &query[i]);
  }
  for (i = 0; i < total; i++) {
    int dif = 7;
    while (1) {
      if (query[i] >= 2 && query[i] <= 7) {
        answer[i] = 1;
        break;
      } else if ((query[i] % dif) < 7 && (query[i] % dif) > 1) {
        answer[i] = (query[i] / dif) + 1;
        break;
      } else if ((query[i] % dif) == 1) {
        dif--;
        answer[i] = (query[i] / dif) + 1;
        break;
      } else if ((query[i] % dif) == 0) {
        answer[i] = query[i] / dif;
        break;
      }
    }
  }
  for (i = 0; i < total; i++) {
    printf("%d\n", answer[i]);
  }
  return 0;
}
