Problem D
Bumper-To-Bumper Traffic

The road is modelled as the real line (units in meters). So
a car is identified with its position on the line. Also, cars
are
Given initial positions of two cars that are driving along the real line in the positive direction and a transcript of their speed changes, did these cars ever collide? While such a collision would be very slow speed (a “bumper tap”), any collision could result in erroneous readings from the black box in the future so the portions of the transcripts after a collision might not make sense.
Input
There is only one test case. The first line contains two
integers
The second line begins with a number
The last line begins with a number
Output
If the vehicles collide, output the message bumper tap at time
Sample Input 1 | Sample Output 1 |
---|---|
0 5 3 1 4 5 3 1 4 6 |
bumper tap at time 6 |
Sample Input 2 | Sample Output 2 |
---|---|
10 0 2 1 2 1 1 |
bumper tap at time 8 |
Sample Input 3 | Sample Output 3 |
---|---|
2 13 1 1 3 4 7 10 |
safe and sound |