1st number: number of targets in the round (bigger than 0)
2nd number: number of hits that the target can withstand (bigger than 0)
3rd number: number of rounds (positive number)
Afterwards, the rounds information. Each of them is made up of two lines:
1st Line: The first number determines the number of targets that will show up (bigger than 0). The succeeding quantity of numbers must match the value of the first number, and those numbers are the targets that will show up in the specific round (from 0 to n - 1).
2nd Line: The first number is the position of the target that you are aiming to shoot (from 0 to n - 1) and the second one is the deviation of the shot (can be negative)
Output
The program must output the total number of hits and destroyed targets.
About statements
The official statement of a problem is always the one
in the PDF document. The HTML version of the statement
is also given to help you, but may contain some content
that is not well displayed. In case of doubt, always use the PDF.