Problems
Farmer John has a block of cheese in the shape of a cube. It lies on the 3-dimensional coordinate plane, extending from
For each update operation, FJ will carve out the
After each update, output the number of distinct configurations that FJ can stick a
Input
The first line contains
The following
Output
After each update operation, output an integer, the number of configurations.
Subtask
| # | Score | Condition |
|---|---|---|
| #1 | 20 | |
| #2 | 30 | |
| #3 | 50 | |
Example
2 5
0 0 0
1 1 1
0 1 0
1 0 0
1 1 0
0
0
1
2
5
After the first three updates, the