Author: Andrew Seidel
Baker Brie is holding a celebration for being in business for
Baker Brie wants to offer congratulations as follows:
- If, in a single day, all franchises combined sell an amount of baked goods that is equivalent to a multiple of a baker's dozen
, then all franchises will receive a bonus. - If an individual franchise, throughout its entire existence, has sold an amount of baked goods that is equivalent to a multiple of a baker's dozen
, then that franchise will receive a bonus.
Input Specification
The input will contain
On the first line of each dataset there will be the values
On the next
Output Specification
You must determine, both for each day (across all franchises) and for each franchise (across all days), whether or not the number of baked goods sold is a multiple of
Sample Input
4 5
4 3 2 4
3 3 2 1
8 2 4 1
2 2 4 3
9 3 2 3
4 2
4 4 4 1
1 1 3 4
Sample Output
4
1
Note: Only
Explanation of Sample Output
In the first case, the first franchise sold a total of
For the second dataset, no franchises made enough baked goods on their own, but there was a single baker's dozen created among them all on the first day. This totals to
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org
Comments