本题原题面确实没有给出 num\mathrm{num}num 的数据范围,但是作了如下保证:
It is guaranteed that all performed operations are correct: Operations will not require to add more balls than there are empty nodes in the ball machine or to remove a ball from an empty node.
然而翻译没有给出。