401937: GYM100589 E Count Distinct Sets

Memory Limit:512 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Count Distinct Setstime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard output

Alice writes a permutation P1, P2, P3, ... PN of [1, 2, 3, ...N]. A permutation that follows the condition:

Pi > Pi / 2 for all i  =  2 to N, is assumed to be an ‘amusing’ permutation. Note that  /  denotes integer division.

Alice wrote down all ‘amusing’ permutations on a sheet of paper. For each number from i  =  1 to N, she defines a set Si. A number j belongs to Si if number i was at j’th position in at-least one of the ‘amusing’ permutations.

You have to find how many distinct Si exist for i  =  1 to N.

Input

First line contains T, the number of test cases. Each test case consists of N in single line.

Output

For each test case, print the required answer in one line.

Constraints

  • 1T104
  • 1N1018
ExamplesInput
2
2
3
Output
2
2
Note

Example 1. Only ‘amusing’ permutations is [1, 2]. [2, 1] is not an ‘amusing’ permutation because P2 < P2 / 2.

S1 is defined as {1} since 1 only occurs at first position in all ‘amusing’ permutations. Similarly S2 is defined as {2}.

Therefore 2 distinct sets are possible ie. {1} and {2}.

Example 2. All ‘amusing’ permutations are: [1, 2, 3] and [1, 3, 2].

S1 is defined as {1} since 1 only occurs at first position in all ‘amusing’ permutations. Similarly S2 is defined as {2, 3} and S3 is also defined as {2, 3}.

So a total of 2 distinct sets {1} and {2, 3} are possible.

加入题单

上一题 下一题 算法标签: