Birthday Gift
CodeChefOpen on judge ↗
Our CTO, Debasis decided to surprise Saurabh on his birthday by giving empty boxes one inside another. Debasis has arranged N numbers of empty boxes with width (W1,W2,W3...Wn) and height (H1,H2,H3...Hn). Now, he put them in a line and started putting one box inside another. He cannot change position of any box, keep them as they are currently, but you have to start from the first box and you can
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.
Sign in to chat with the tutor and save your progress.
Sign in to start