Three Boxes
Chef has $3$ boxes of sizes $A$, $B$, and $C$ respectively. He puts the boxes in bags of size $D$ ($A \leq B \leq C \leq D$). Find the minimum number of bags Chef needs so that he can put each box in a bag. A bag can contain more than one box if the sum of sizes of boxes in the bag does not exceed the size of the bag. ### Input - The first line contains $T$ denoting the number of test cases. Then
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