You have to go on a trip in your car which can hold a limited amount of fuel. You know how many liters of fuel your car uses per hour for certain speeds and you have to find out how far a certain amount of fuel will take you when travelling at the optimal speed.
You will be given a set of speeds, a corresponding set of fuel consumption and an amount that tells you the amount of fuel in your tank.
The input will be
You have to tell what is the maximum distance that the car can travel (in kilometers) with the given amount of fuel, and travelling at a constant speed equal to one of the elements of speeds.
Note:
You have to return a double value, with upto 3 digits after the decimal