← All problemsSign in

Stairway Reduction

A garrison of soldiers is stationed at an old fort built long ago by a king located on the top of a hill. The fort can be accessed only by a cemented stairway with **K** steps (steps are numbered 1 to **K** from the bottommost to the topmost as shown below). The width of all the steps in the stairway is the same (**w**), but the length (**l**) and the height (**h**) of each step is made different

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