#P1537. 弹珠

弹珠

Description

Masha and Bill each have their own marble collections. They want to redistribute the collections so that both of them have the same number of marbles. If all marbles had the same value, they could split them evenly. Unfortunately, some marbles are larger or more beautiful, so Masha and Bill assign each marble a value from 11 to 66. Now they want to divide the marbles so that each person receives the same total value. Unfortunately, they find that they may not be able to split the marbles this way (even if the total value of all marbles is even). For example, if there is one marble of value 11, one of value 33, and two of value 44, then they cannot divide the marbles into two parts with equal value. Therefore, they want you to write a program to tell them whether it is possible to split all the marbles into two parts with equal total value.

Input Format

The input contains several lines, each with six non-negative integers N1,,N6N_1,\cdots,N_6, where NiN_i is the number of marbles with value ii. The maximum total number of marbles is up to 2×1042\times 10^4.

The last line of the input is 0 0 0 0 0 0. Do not process this line.

Output Format

For each dataset, output Collection #k:, where kk is the dataset number starting from 11, followed by Can be divided. or Can't be divided..

Print an extra blank line after each dataset. You may refer to the sample.

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.

Hint

Translated by ChatGPT 5