Desert
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 256 megabytes
Determine the minimum fuel reserve required at the starting point for a rover to complete a journey across a desert track of a specified length. The rover can only refuel using a tank of known capacity, with a fuel consumption rate of one liter per kilometer. You may carry an unlimited number of empty containers, which can be placed at any location along the track and filled with fuel solely from the tank.
Input
The input consists of two numbers separated by a space: the length of the track in kilometers and the capacity of the rover's tank in liters. It is guaranteed that the ratio of the track length to the tank size does not exceed 5.
Output
The output should be a single number representing the solution to the problem, formatted to 6 decimal places.
Examples
Input #1
Answer #1
Submissions 24
Acceptance rate 63%