As Chief Administrator in the Strategic Systems Division, you have noticed that the current performance guidelines do not sufficiently penalize the unnecessary use of expensive ammunition. Therefore, you are to create a new post-battle analysis tool that takes excess ammunition consumption into consideration.
A battle consists of the following elements:
Shots. A shot is a circularly explosive countermeasure. It has a fixed position and a second duration. During this time, its radius increases from to km and then back to according to the formula: r = \sqrt{1 - (t - 1) ^ 2}.
The ground, at y = 0.
Missiles. A missile is a point particle moving at a constant velocity. If a missile collides with a shot, it is neutralized. If a missile hits the ground before being neutralized, it is considered to have hit its target.
NOTE 1: If a missile hits a shot, the shot does not disappear – it may still hit other missiles.
NOTE 2: Shots with a radius of cannot hit missiles (e.g., a missile passes through an expired shot).
Performance is evaluated on a simple point scale as follows:
Each neutralized missile adds point.
Each missile that reaches its target subtracts points.
Each unnecessary shot subtracts points. The number of unnecessary shots is the difference between the total number of shots fired and the size of the smallest subset of those shots that would have neutralized the same number of missiles.
Input is provided in the following format (legend below):
...
...
...
In the legend below, indentation denotes repetition of the indented block a number of times equal to the preceding value:
(0 < nb) – number of battles (0 \le nm \le 20) – number of missiles/ (0.0 < my) – initial position of missile (in km)/ – missile velocity (in km/s) (0.0 \le mt) – time since the start of battle the missile appears (in seconds) (0 \le ns \le 20) – number of shots/ (1.0 \le sy) – position of shot at moment of detonation (in km) (0.0 \le st) – time since start of battle the shot detonates (in seconds)
For each battle, output a line containing the score for that battle.
Example 1