← All problemsSign in

Men and Horses

There are $n_m$ men living in a town. They have $n_h$ horses, each capable of carrying only one man at a time. All the men are supposed to attend a dinner party $d$ km away from their house. They should start their journey together and reach the destination in minimum time. The speed of each man is $v_m$ km/hour whereas the speed of each horse (with or without somebody on back) is $v_h$ km/hour. Y

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