← All problemsSign in

Maximise Value

Charan is packing for a vacation and is allowed to carry only 1 bag with capacity X. He also have N items that he want to take along with him. Unfortunately he can not fit all of them so he has to choose them. For Each item it’s size and value are given. Your task is to maximize the total value of all items charan is going to carry. Input On the first line you are given X and N. N lines fo

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