CF1900B.Laura and Operations

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

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.

劳拉是一个不喜欢组合数学的女孩。内马尼亚想说服她改变看法。

内马尼亚在黑板上写了一些数字,这些数字只可能是 11、22 或 33。其中数字 11 的个数为 aa,数字 22 的个数为 bb,数字 33 的个数为 cc。他告诉劳拉:在一次操作中,她可以执行以下步骤:

  • 选择两个不同的数字,并将它们从黑板上擦除;然后,在黑板上写下既不同于第一个也不同于第二个的那一个数字(即剩下的那个在 {1,2,3}\{1,2,3\} 中未被选中的数字)。

例如,假设黑板上的数字为 11, 11, 11, 22, 33, 33。她可以选择数字 11 和 33 并将它们擦除,此时黑板变为 11, 11, 22, 33;接着她必须写下另一个数字 22,因此该次操作结束后,黑板上的数字为 11, 11, 22, 33, 22。

内马尼亚问她:经过若干次这样的操作后,是否可能使黑板上只剩下同一种数字?如果可能,这种数字可以是哪几种?

劳拉无法解决这个问题,于是向你求助。作为对她提供帮助的奖励,她会说服内马尼亚给你一些分数。

输入格式

Each test contains multiple test cases. The first line contains the number of test cases tt (1≤t≤1051 \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 (1≤a,b,c≤1001 \le a, b, c \le 100) — the number of ones, number of twos, and number of threes, respectively.

每个测试包含多个测试用例。第一行包含测试用例的数量 tt(1≤t≤1051 \le t \le 10^5)。随后是各测试用例的描述。

每个测试用例仅有一行,包含三个整数 aa、bb、cc(1≤a,b,c≤1001 \le a, b, c \le 100),分别表示数字 1、2 和 3 的个数。

输出格式

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.

对于每个测试用例,输出一行,包含 33 个整数。

第一个整数:若存在某种操作序列使得最终黑板上仅剩下数字 11,则为 11,否则为 00。

第二个整数:若存在某种操作序列使得最终黑板上仅剩下数字 22,则为 11,否则为 00。

第三个整数:若存在某种操作序列使得最终黑板上仅剩下数字 33,则为 11,否则为 00。

输入输出样例

  • 输入#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.

在第一个测试用例中,Laura 可以移除数字 22 和 33,并写入数字 11。此后,黑板上将剩下两个数字 11。她可通过执行类似的操作,使黑板上最终仅剩数字 22 或仅剩数字 33。

在第二个测试用例中,她可以移除数字 11 和 33,并写入数字 22。执行该操作 22 次后,黑板上将仅剩数字 22。可以证明:不存在任何方式使黑板上最终仅剩数字 11 或仅剩数字 33。

在第三个测试用例中,存在一系列操作,可使黑板上最终仅剩数字 11。可以证明:不存在任何方式使黑板上最终仅剩数字 22 或仅剩数字 33。

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

首页