CF2184A.Social Experiment

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Social Experiment

Right now, the largest social experiment in the history of Codeforces is taking place, involving nn people. They are required to form teams of 232-3 people, after which each team chooses one of two civilizations to participate in the social experiment.

The organizers of this social experiment want to know what the possible difference in the number of people in the civilizations could be. Find the minimum possible difference.

Input

Each test consists of several test cases. The first line contains a single integer tt (1t104)(1 \le t \le 10^4) — the number of test cases. The following lines describe the test cases.

In the only line of each test case, there is an integer nn — the number of people participating in the social experiment (2n104)(2 \le n \le 10^{4}).

Output

For each number nn, output the minimum possible difference between the number of people in the civilizations.

Note

In the first test case, only one team can be formed, which will choose one of the civilizations, while the other will have no one, so the answer is 22.

In the second test case, two teams can be formed: one with two people and the other with three. These teams will choose different civilizations; thus, the answer will be 11.

In the third test case, four teams of three people will be formed, with the first two choosing the first civilization and the remaining two choosing the second. The answer is 00.

Samples

3
2
5
12
2
1
0

在线编程 IDE

建议全屏模式获得最佳体验