← All problemsSign in

Diet

Mr. Robert, like so many of her sisters, has put on a few too many pounds enjoying the delectable grass from Farmer John's pastures. FJ has put her on a strict diet of no more than H (5 Mr. Robert can eat only complete bales of hay; once she starts she can't stop. She has a complete list of the N (1 Given the list of haybale weights W_i (1 INPUT FORMAT: * Line 1: Two space-separated integers: H

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