#P9867. D. Medians Strike Back

D. Medians Strike Back

D. Medians Strike Back

Problem Description

Define the median of a sequence of length nn as: If nn is odd, the median is the number ranked n+12\lfloor \dfrac {n+1} 2\rfloor if we sort the sequence in ascending order. If nn is even, the median is the number that has more occurences between the numbers ranked n2\lfloor \dfrac {n} 2\rfloor and n2+1\lfloor \dfrac {n} 2+1\rfloor if we sort the sequence in ascending order. If they appeared for the same number of times the smaller one is the median. Define the shikness of a sequence AA as the number of occurences of the median of AA. Define the nitness of a sequence AA as the maximum shikness over all continuous subsequences of AA. You want to find a sequence AA of length nn, satisfying 1Ai31\leq A_i\leq 3 for every 1in1\le i\leq n, with the minimum nitness. Calculate the nitness of such sequence.

Input

The input consists of multiple test cases. The first line contains a single integer TT (1T2×1051 \le T \le 2 \times 10 ^ 5) - the number of test cases. Description of the test cases follows. The first line of each test case contains one integer nn (1n1091 \leq n \leq 10^9).

Output

For each test case, print a single integer - the nitness of such sequence.

Sample Input

6
1
2
3
4
5
6

Sample Output

1
1
1
2
2
2

Source

2023“钉耙编程”中国大学生算法设计超级联赛(7)