Problem I
Test Drive
Larry developed a new driverless car, and he’s about to test it. He’ll be working from home and analyzing what the car does in a straight, empty road from a safe distance.
Due to an unprecedented issue, the only information that Larry’s able to get from the car is its position in meters from the start of the road. While he gets an update every minute, he would like to know what the car has been doing.
Given three distinct positions
Input
Input consists of a single line with three distinct
space-separated integers
Output
If the car changed direction, output turned. Otherwise, output accelerated if it travelled a greater distance in the second minute than the first, braked if it travelled a smaller distance in the second minute than the first, or cruised if it travelled the same distance during both minutes.
Sample Input 1 | Sample Output 1 |
---|---|
1 2 3 |
cruised |
Sample Input 2 | Sample Output 2 |
---|---|
5 4 1 |
accelerated |
Sample Input 3 | Sample Output 3 |
---|---|
8 9 7 |
turned |
Sample Input 4 | Sample Output 4 |
---|---|
10 20 25 |
braked |