CF1900B.Laura and Operations

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

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 11 , 22 , or 33 . The number of digits 11 is aa . The number of digits 22 is bb and the number of digits 33 is cc . 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 ( 11 , 22 , or 33 ) different from both erased digits.

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

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.

输入格式

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

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

输出格式

For each test case, output one line containing 33 integers.

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

Similarly, the second one should be 11 if it is possible that after some operations only digits 22 remain on the board, and 00 otherwise.

Similarly, the third one should be 11 if it is possible that after some operations only digits 33 remain on the board, and 00 otherwise.

输入输出样例

  • 输入#1

    3
    1 1 1
    2 3 2
    82 47 59

    输出#1

    1 1 1
    0 1 0
    1 0 0

说明/提示

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

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

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

首页