#C6113. Delivery Cost Calculation
Delivery Cost Calculation
Delivery Cost Calculation
You are required to compute the delivery cost of a truck for a given route. You are provided with four values:
- route_distance: the distance of the route in km.
- fuel_efficiency: the fuel efficiency of the truck in km per litre.
- max_distance: the maximum distance the truck can drive in a day in km.
- fuel_cost: the cost of fuel per litre in currency units.
If the route_distance exceeds the max_distance, output impossible
. Otherwise, calculate the delivery cost using the formula:
$$cost = \left(\frac{\text{route\_distance}}{\text{fuel\_efficiency}}\right) \times \text{fuel\_cost}$$
Round the result to 2 decimal places and output it.
inputFormat
The input consists of a single line containing four space-separated values:
- route_distance (a floating-point number)
- fuel_efficiency (a floating-point number)
- max_distance (a floating-point number)
- fuel_cost (a floating-point number)
outputFormat
If the route_distance exceeds the max_distance, output impossible
. Otherwise, output the delivery cost rounded to 2 decimal places. The output should be printed to stdout.
800 10 500 1.5
impossible