#Lutece1498. Equation
Equation
Migrated from Lutece 1498 E
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Little Ruins is a studious boy, recently he learned addition operation! He was rewarded some number bricks of to and infinity bricks of addition mark +
and equal mark =
.
Now little Ruins is puzzled by those bricks because he wants to put those bricks into as many different addition equations form as possible. Each brick can be used at most once and , , are one digit integer.
As Ruins is a beginer of addition operation, , and will be single digit number.
Two addition equations are different if any number of , and is different.
Please help little Ruins to calculate the maximum number of different addition equations.
Input
First line contains an integer (), which indicates the number of test cases.
Every test case contains one line with nine integers (), the -th integer indicates the number of bricks of .
Output
For every test case, you should output Case #x: y
, where x
indicates the case number and counts from and y
is the result.
Samples
3
1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2
0 3 3 0 3 0 0 0 0
Case #1: 2
Case #2: 6
Case #3: 2
Resources
第二届中国大学生程序设计竞赛 杭州站(CCPC 2016 Hangzhou Site)