Get revenge! X90843


Statement
 

pdf   zip

html

Input

  • The first line has 3 numbers.
    • 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.

Public test cases
  • Input

    6 2 5
    3 1 2 3
    1 1
    2 2 5
    5 1
    2 4 5
    0 -1
    2 0 3
    2 1
    1 3
    3 0
    

    Output

    TR-8R hit 3 targets and destroyed 1
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    C++
    User solutions