Problems
In the game "Duck, Duck, Goose", all players but one sit on the floor and form a circle. The remaining player walks around the circle calling each player "duck" until they select one sitting player and, while touching their head, call them "goose" instead. At that point, the goose chases the selecting player and our interest in the game fades.
In the new game "Duck, Duck, Geese", the walking player instead chooses a contiguous subset of
at least two (but not all) sitting players to be "geese"! Furthermore, each sitting player is
wearing a hat. Each hat is one of
For each color
Can you help count the number of choices that fulfill these requirements? Two choices are considered different if there is some player that is included in one choice but not the other.
Input
The first line of the input gives the number of test cases,
Output
For each test case, output one line containing Case #,
where
Example
3
3 2
1 1
1 1
1 1 2
5 2
1 1
1 2
1 2 1 2 2
3 3
1 2
1 2
2 2
1 1 3
Case #1: 2
Case #2: 9
Case #3: 1