← All problemsSign in

8 - Cheapest Travel Plan

You have a car that runs on both petrol and diesel. The prices of petrol and diesel per unit volume are $P_p$ and $P_d$ respectively. Using one unit volume of fuel, you can travel one unit distance. The petrol tank of your car has a capacity $C_p$ units. (It means that at any instant, your car can store no more than $C_p$ volume of petrol. The diesel tank of your car has a capacity $C_d$. There

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start