Viking Assault X40503


Statement
 

pdf   zip

html

Input On the first line, we are given the number of targets and the number of shots taken, separated by a space. Then, for each target, we are given the coordinates X and Y respectively in each line, separated by a space. Finally, for each shot, we are given the angle at which the cannon was placed, and the reach of the shot from the ship, separated by a space.

Output Each output line corresponds to an input target, in the same order the targets were given. If the target has been sunk, the output should be “DESTROYED”; if not, then the output should be the ship’s remaining health percentage (as an integer value).

Public test cases
  • Input

    4 3
    -10 10
    0 20
    5 19
    10 10
    45 10
    99 22
    89 20
    
    

    Output

    100
    DESTROYED
    95
    83
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    C++
    User solutions
    C++ Python