310855: CF1900B. Laura and Operations

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Laura and Operationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Laura is a girl who does not like combinatorics. Nemanja will try to convince her otherwise.

Nemanja wrote some digits on the board. All of them are either $1$, $2$, or $3$. The number of digits $1$ is $a$. The number of digits $2$ is $b$ and the number of digits $3$ is $c$. He told Laura that in one operation she can do the following:

  • Select two different digits and erase them from the board. After that, write the digit ($1$, $2$, or $3$) different from both erased digits.

For example, let the digits be $1$, $1$, $1$, $2$, $3$, $3$. She can choose digits $1$ and $3$ and erase them. Then the board will look like this $1$, $1$, $2$, $3$. After that, she has to write another digit $2$, so at the end of the operation, the board will look like $1$, $1$, $2$, $3$, $2$.

Nemanja asked her whether it was possible for only digits of one type to remain written on the board after some operations. If so, which digits can they be?

Laura was unable to solve this problem and asked you for help. As an award for helping her, she will convince Nemanja to give you some points.

Input

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^5$). The description of the test cases follows.

The first and only line of each test case contains three integers $a$, $b$, $c$ ($1 \le a, b, c \le 100$) — the number of ones, number of twos, and number of threes, respectively.

Output

For each test case, output one line containing $3$ integers.

The first one should be $1$ if it is possible that after some operations only digits $1$ remain on the board, and $0$ otherwise.

Similarly, the second one should be $1$ if it is possible that after some operations only digits $2$ remain on the board, and $0$ otherwise.

Similarly, the third one should be $1$ if it is possible that after some operations only digits $3$ remain on the board, and $0$ otherwise.

ExampleInput
3
1 1 1
2 3 2
82 47 59
Output
1 1 1
0 1 0
1 0 0
Note

In the first test case, Laura can remove digits $2$ and $3$ and write digit $1$. After that, the board will have $2$ digits $1$. She can make it have only digits $2$ or $3$ left by performing a similar operation.

In the second test case, she can remove digits $1$ and $3$ and write a digit $2$. After performing that operation $2$ times, the board will have only digits $2$ left. It can be proven that there is no way to have only digits $1$ or only digits $3$ left.

In the third test case, there is a sequence of operations that leaves only digits $1$ on the board. It can be proven that there is no way to have only digits $2$ or only digits $3$ left.

Output

题目大意:
Laura是一个不喜欢组合数学的女孩,Nemanja试图说服她。Nemanja在黑板上写下了一些数字,这些数字都是1、2或3。1的数量是a,2的数量是b,3的数量是c。他告诉Laura,在一次操作中,她可以执行以下操作:选择两个不同的数字并将它们从黑板上擦除,然后写下与两个擦除数字都不同的数字(1、2或3)。例如,如果数字是1、1、1、2、3、3,她可以选择数字1和3并擦除它们。然后,她必须写下另一个数字2,所以操作结束后,黑板上的数字将是1、1、2、3、2。Nemanja问她是否可能在进行一些操作后,黑板上只剩下一种数字。如果是的话,这些数字可以是什么?Laura无法解决这个问题,并向您寻求帮助。

输入输出数据格式:
输入:
每个测试包含多个测试用例。第一行包含测试用例的数量t(1≤t≤10^5)。接下来是每个测试用例的描述。
每个测试用例只有一行,包含三个整数a、b、c(1≤a,b,c≤100)——分别是1的数量、2的数量和3的数量。

输出:
对于每个测试用例,输出一行,包含3个整数。
第一个数应该是1,如果有可能通过一些操作使黑板上只剩下数字1,否则为0。
第二个数应该是1,如果有可能通过一些操作使黑板上只剩下数字2,否则为0。
第三个数应该是1,如果有可能通过一些操作使黑板上只剩下数字3,否则为0。

示例:
输入:
3
1 1 1
2 3 2
82 47 59

输出:
1 1 1
0 1 0
1 0 0

注意:
在第一个测试用例中,Laura可以移除数字2和3,并写下数字1。之后,黑板上将有2个数字1。她可以通过执行类似操作使黑板上只剩下数字2或3。
在第二个测试用例中,她可以移除数字1和3,并写下数字2。执行该操作2次后,黑板上将只剩下数字2。可以证明,没有办法让黑板上只剩下数字1或数字3。
在第三个测试用例中,存在一系列操作,使黑板上只剩下数字1。可以证明,没有办法让黑板上只剩下数字2或数字3。题目大意: Laura是一个不喜欢组合数学的女孩,Nemanja试图说服她。Nemanja在黑板上写下了一些数字,这些数字都是1、2或3。1的数量是a,2的数量是b,3的数量是c。他告诉Laura,在一次操作中,她可以执行以下操作:选择两个不同的数字并将它们从黑板上擦除,然后写下与两个擦除数字都不同的数字(1、2或3)。例如,如果数字是1、1、1、2、3、3,她可以选择数字1和3并擦除它们。然后,她必须写下另一个数字2,所以操作结束后,黑板上的数字将是1、1、2、3、2。Nemanja问她是否可能在进行一些操作后,黑板上只剩下一种数字。如果是的话,这些数字可以是什么?Laura无法解决这个问题,并向您寻求帮助。 输入输出数据格式: 输入: 每个测试包含多个测试用例。第一行包含测试用例的数量t(1≤t≤10^5)。接下来是每个测试用例的描述。 每个测试用例只有一行,包含三个整数a、b、c(1≤a,b,c≤100)——分别是1的数量、2的数量和3的数量。 输出: 对于每个测试用例,输出一行,包含3个整数。 第一个数应该是1,如果有可能通过一些操作使黑板上只剩下数字1,否则为0。 第二个数应该是1,如果有可能通过一些操作使黑板上只剩下数字2,否则为0。 第三个数应该是1,如果有可能通过一些操作使黑板上只剩下数字3,否则为0。 示例: 输入: 3 1 1 1 2 3 2 82 47 59 输出: 1 1 1 0 1 0 1 0 0 注意: 在第一个测试用例中,Laura可以移除数字2和3,并写下数字1。之后,黑板上将有2个数字1。她可以通过执行类似操作使黑板上只剩下数字2或3。 在第二个测试用例中,她可以移除数字1和3,并写下数字2。执行该操作2次后,黑板上将只剩下数字2。可以证明,没有办法让黑板上只剩下数字1或数字3。 在第三个测试用例中,存在一系列操作,使黑板上只剩下数字1。可以证明,没有办法让黑板上只剩下数字2或数字3。

加入题单

上一题 下一题 算法标签: