Subway trains are meant to move people as quickly, safely, and comfortably as possible from station to station. Although the train drivers' unions may not agree, computer operated trains accomplish these goals more effectively than human operated trains. You are to determine the optimal control strategy to move the train from one station to another within the constraints imposed by safety and comfort considerations, as well as the physical limitations of the train itself.
The parameters to the problem are all positive integers not greater than 1000.
There are several test cases. For each test case, standard input has a single line with d, m, a, j.
For each test case, standard output should contain a single line giving the minimum time in seconds, to the nearest 0.1 second, required to move between the stations.
1000 70 20 1
31.7