Problem AJ
Odometer Analysis
Tommy Catkins wants to buy a used car, and has asked you to help him figure out if it has been serviced appropriately. You happen to know with certainty that the only previous owner of the car Tommy is interested in was a travelling salescat who drove at least $2\, 000$ km and at most $20\, 000$ km every single month. In addition, by Catland law, each car should be serviced at least every $30\, 000$ km or $12$ months, whichever comes first, but you do not know if this has actually been done or not.
The service history entries indicate the approximate time the service took place, and the reading of the odometer at that time. The maximum distance the odometer can measure is $99\, 999$ km. Upon reaching $100\, 000$ km traveled, the odometer resets to $0$ km. In addition, the entries do not indicate exact time, only the year and month. In particular, even though you know that the car traveled between $2\, 000$ and $20\, 000$ km every month, you do not know how much of that distance was traveled before the service. For the purpose of the $12$ month rule, it does not matter which day during the month a service took place. For instance, it is perfectly fine if a service takes place on January 1 2017, and then the next service takes place on January 31 2018 (assuming the car did not travel more than $30\, 000$ km during this time).
Given the service history entries, you must first determine whether it is possible that these are correct, or whether it can be conclusively proven that the odometer must have been tampered with. In the former case, assuming the odometer has not been tampered with, you must then determine whether or not the car has been serviced sufficiently often.
Input
The first line of input contains an integer $1 \le e \le 500$, the number of entries in the service history.
Next follow $e$ lines that describe the entries in the service history. Each such entry is given by three integers $y$, $m$, $o$, where $1950 \le y \le 2050$ and $1 \le m \le 12$ is the year and month of the service (respectively), and $0 \le o \le 99\, 999$ is the reading of the odometer for that entry. The service entries are given in chronological order from oldest to most recent. The first service entry represents the purchase of the car when it was brand new and has $o=0$ (but the previous owner may still have travelled some or all of the distance for that month prior to buying the car). There may be multiple service entries in the same month (but they are still given in chronological order).
Output
If it can be conclusively proven that the odometer must have been tampered with, output “tampered odometer”. Otherwise, if, assuming the odometer was not tampered with, the car can not have been serviced often enough, output “insufficient service”. Otherwise, output “seems legit”.
Sample Input 1 | Sample Output 1 |
---|---|
3 2017 4 0 2017 8 12000 2018 8 42000 |
seems legit |
Sample Input 2 | Sample Output 2 |
---|---|
3 2017 4 0 2017 8 12000 2018 8 42001 |
insufficient service |
Sample Input 3 | Sample Output 3 |
---|---|
2 2017 11 0 2018 1 1000 |
tampered odometer |
Sample Input 4 | Sample Output 4 |
---|---|
2 2013 1 0 2013 2 0 |
seems legit |
Sample Input 5 | Sample Output 5 |
---|---|
2 1980 1 0 1980 6 1000 |
insufficient service |