Easy Problem
CodeChefOpen on judge ↗
Chef is moving soon, and he wants to choose a truck that can hold a certain amount of weight. He knows the weights of all the items he is putting on the truck. Can you help him determine the maximum number of items that he can put on a truck of any given weight? You are given an array a of n integers, the weights of the items. Then, you are given q queries, each of which is a possible weight of a
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