Problem F
Colliding Traffic
For a boat on a small, constrained body of water, other traffic can be a major hazard. The more traffic there is in the same area, the higher the risk of a collision.
Your job is to monitor traffic and help detect likely collisions before they occur. You have sensors to detect the position, direction, and speed of each boat. Assuming the direction and speed remain constant, your task is to determine whether any of the boats will collide. Two boats are considered to collide if they come within a given distance of each other.
Input
The first line of input contains a single integer
Output
For each test case, output a line containing a single
integer, the number of seconds, rounded to the nearest second,
before any of the boats come within
No collision.
Sample Input 1 | Sample Output 1 |
---|---|
2 2 5 0 0 90 1 10 10 180 1 2 10 0 0 0 0 8 8 270 1 |
6 2 |