Time Limit: Java: 10000 ms / Others: 10000 ms
Memory Limit: Java: 32768 KB / Others: 32768 KB
Factory management needs to predict the number of holes in the plate at the end of the given sequence of cuts. Write a program that answers this question. Single segment cuts are not considered to be holes.
Here there are examples of some situations that can arise after cutting:
two holes two holes one hole one hole
The last block consists of just one line containing 0.
There is no line in the output corresponding to the last ``null'' block of the input.