#pragma comment(linker, "/STACK:102400000,102400000") //#include #include #include #include #include #include #include #include #include #include #include #define fi first #define se second #define endl '\n' #define o2(x) (x)*(x) #define BASE_MAX 31 #define mk make_pair #define eb emplace_back #define SZ(x) ((int)(x).size()) #define all(x) (x).begin(), (x).end() #define clr(a, b) memset((a),(b),sizeof((a))) #define iis std::ios::sync_with_stdio(false); cin.tie(0) #define my_unique(x) sort(all(x)),x.erase(unique(all(x)),x.end()) using namespace std; #pragma optimize("-O3") typedef long long LL; typedef unsigned long long uLL; typedef pair pii; inline LL read() { LL x = 0;int f = 0; char ch = getchar(); while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar(); while (ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + ch - '0', ch = getchar(); return x = f ? -x : x; } inline void write(LL x, bool f) { if (x == 0) {putchar('0'); if(f)putchar('\n');else putchar(' ');return;} if (x < 0) {putchar('-');x = -x;} static char s[23]; int l = 0; while (x != 0)s[l++] = x % 10 + 48, x /= 10; while (l)putchar(s[--l]); if(f)putchar('\n');else putchar(' '); } int lowbit(int x) { return x & (-x); } templateT big(const T &a1, const T &a2) { return a1 > a2 ? a1 : a2; } templateT sml(const T &a1, const T &a2) { return a1 < a2 ? a1 : a2; } templateT big(const T &f, const R &...r) { return big(f, big(r...)); } templateT sml(const T &f, const R &...r) { return sml(f, sml(r...)); } void debug_out() { cerr << '\n'; } templatevoid debug_out(const T &f, const R &...r) {cerr << f << " ";debug_out(r...);} #define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__); const LL INFLL = 0x3f3f3f3f3f3f3f3fLL; const int HMOD[] = {1000000009, 1004535809}; const LL BASE[] = {1572872831, 1971536491}; const int mod = 1e9 + 7;//998244353 const int MOD = 1e9 + 7; const int INF = 0x3f3f3f3f; const int MXN = 1e6 + 7; const int MXE = 1e6 + 7; LL n, m; LL dp[MXN]; int main() { #ifndef ONLINE_JUDGE freopen("/home/cwolf9/CLionProjects/ccc/in.txt", "r", stdin); // freopen("/home/cwolf9/CLionProjects/ccc/out.txt", "w", stdout); #endif int tim = read(); while(tim --) { n = read(); if(n <= 2) { printf("1\n"); }else if(n % 6 == 0) { printf("%I64d\n", n/2); }else if(n % 6 == 5 || n % 6 == 3) { printf("%I64d\n", n/6); }else if(n % 6 == 4) { printf("%I64d\n", 3 + (n/6)*6); }else if(n % 6 == 2) { printf("%I64d\n", 1 + n/6*3); }else { printf("%I64d\n", 1 + n/6*4); } } return 0; }