1.25号英语翻译
题目来源:http://noi.openjudge.cn/ch0405/16/
重点词汇:
marbles:n.弹珠
assigning :v.分配
16:Dividing
分割,划分
- 查看
- 提交
- 统计
- 提问
- 总时间限制:
- 1000ms
- 内存限制:
- 65536kB
- 描述
- Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could just split the collection in half. But unfortunately, some of the marbles are larger, or more beautiful than others. So, Marsha and Bill start by assigning a value, a natural number between one and six, to each marble. Now they want to divide the marbles so that each of them gets the same total value. Unfortunately, they realize that it might be impossible to divide the marbles in this way (even if the total value of all marbles is even). For example, if there are one marble of value 1, one of value 3 and two of value 4, then they cannot be split into sets of equal value. So, they ask you to write a program that checks whether there is a fair partition of the marbles.
- 玛莎和比尔拥有一系列弹珠,他们想在他们自己之间拆分这些收藏品,以便双方都能获得同等份额的弹珠。如果所有的弹珠有相同价值的话,这将会很简单,因为他们只需要将他们拆半分。但是很不幸的是,一些弹珠比其它要更大或者更漂亮。因此,玛莎和比尔首先为要每个弹珠分配一个值,一个介于 1 到 6 之间的自然数。 现在他们想划分弹珠,使得他们都可以获得相同的总价值。不幸的是,他们意识到以这种方式分配可能是不可能的(即使所有的弹珠价值总量是偶数)。例如,如果这有一个弹珠价值为1,一个价值为3,两个价值为4,之后他们不能将它们分为等价值的两份。所以,他们叫你来编写一个程序来检查弹珠是否能公平划分。
- 输入
- Each line in the input file describes one collection of marbles to be divided. The lines contain six non-negative integers n1 , . . . , n6 , where ni is the number of marbles of value i. So, the example from above would be described by the input-line "1 0 1 2 0 0". The maximum total number of marbles will be 20000.
The last line of the input file will be "0 0 0 0 0 0"; do not process this line. - 输入文件的每一行都描述了一组要分割的弹珠。 这些行包含六个非负整数 n1 , 。 . . , n6 , 其中 ni 是值为 i 的弹珠的数量。 因此,上面的示例将由输入行“1 0 1 2 0 0”来描述。 弹珠的最大总数为 20000。
- 输入文件的最后一行将是“0 0 0 0 0 0”; 不处理此行。
- 输出
- For each collection, output "Collection #k:", where k is the number of the test case, and then either "Can be divided." or "Can't be divided.".
Output a blank line after each test case. -
对于每一组集合,输出“Collection #k:”,其中 k 是测试用例的数量,然后是“可以划分”。 或“不可分割。”。
在每个测试用例之后输出一个空行。 - 样例输入
-
1 0 1 2 0 0 1 0 0 0 1 1 0 0 0 0 0 0
- 样例输出
-
Collection #1: Can't be divided. Collection #2: Can be divided.
- 来源
- Mid-Central European Regional Contest 1999