CF2184A.Social Experiment

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Right now, the largest social experiment in the history of Codeforces is taking place, involving nn people. They are required to form teams of 2−32-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.

目前,Codeforces 历史上规模最大的社会实验正在进行中,共有 nn 人参与。他们需组成每队 22 至 33 人的团队,之后每个团队需从两种文明中选择一种,以参与该社会实验。

本次社会实验的组织者希望了解两种文明中人数之差的可能取值。请找出该差值的最小可能值。

输入格式

Each test consists of several test cases. The first line contains a single integer tt (1≤t≤104)(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 (2≤n≤104)(2 \le n \le 10^{4}).

每个测试包含若干测试用例。第一行包含一个整数 tt (1≤t≤104)(1 \le t \le 10^4) —— 测试用例的数量。接下来的行描述各个测试用例。

每个测试用例仅有一行,其中包含一个整数 nn —— 参与社会实验的人数 (2≤n≤104)(2 \le n \le 10^{4})。

输出格式

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

对于每个数字 nn,输出两个文明中人数的最小可能差值。

输入输出样例

  • 输入#1

    3
    2
    5
    12

    输出#1

    2
    1
    0

说明/提示

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.

在第一个测试用例中,只能组成一个队伍,该队伍将选择其中一种文明,而另一种文明将无人选择,因此答案为 22。

在第二个测试用例中,可以组成两个队伍:一个队伍有两人,另一个队伍有三人。这两个队伍将选择不同的文明;因此答案为 11。

在第三个测试用例中,将组成四个每队三人的队伍,其中前两个队伍选择第一种文明,后两个队伍选择第二种文明。答案为 00。

输入解题思路,AI测评打分。不知道怎么写?

首页