You are planning the train schedule and you want to know the minimum time between the stations.
Each section of the rail between stations is given in the Array.
Each section is a tuple of distance and speed limit (both are integers).
You can change the speed ( +1. -1 and ± 0 ) at the start and every minute after that.
Note: This means that a train with a speed of 2 will travel a distanse of 2 before another minute passes and its speed can be changed again.