#include using namespace std; int main() { /* int s_a[100]; s_a[1] = 1; int sum; for (int i = 2; i < 100; i++) { sum = 0; for (int k = 1; k < i; k++) sum = (sum + s_a[k] * k) % i; s_a[i] = sum; } for (int i = 1; i < 100; i++) cout << i << " : " << s_a[i] << endl; */ int T; cin >> T; long long in; long long a; long long b; for (int i = 0; i < T; i++) { cin >> in; if (in == 1 || in == 2) cout << "1" << endl; else { a = (in - 3) / 6; b = (in - 3) % 6; switch (b) { case(0): case(2): cout << a << endl; break; case(1): cout << 3 + a * 6 << endl; break; case(3): cout << 3 + a * 3 << endl; break; case(4): cout << 5 + a * 4 << endl; break; case(5): cout << 4 + a * 3 << endl; break; } } } return 0; }