Missile Command#1216

Missile Command

1 second
128 megabytes
Very hard

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:

Performance is evaluated on a simple point scale as follows:

Input

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)

Output

For each battle, output a line containing the score for that battle.

Examples

Example 1

Loading
Loading