问题 D: Medians Strike Back

内存限制:512 MB 时间限制:6 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

Define the median of a sequence of length n as:

If n is odd, the median is the number ranked  if we sort the sequence in ascending order

If n is even, the median is the number that has more occurences between the numbers ranked  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 A as the number of occurences of the median of A.

Define the nitness of a sequence A as the maximum shikness over all continuous subsequences of A.

You want to find a sequence A of length n, satisfying 1Ai3 for every 1in, with the minimum nitness.

Calculate the nitness of such sequence.



输入格式

The input consists of multiple test cases. The first line contains a single integer T (1T2×10^5) - the number of test cases. Description of the test cases follows.

The first line of each test case contains one integer n (1n10^9).

输出格式

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

输入样例 复制

6
1
2
3
4
5
6

输出样例 复制

1
1
1
2
2
2

分类标签