Trick Or Treat
Halloween is approaching, and you plan to distribute sweets to the children visiting your house. You expect a total of $M$ children. You have $N$ boxes of candies and $N$ boxes of chocolates. The $i^{th}$ candy box contains $A_i$ candies, and the $i^{th}$ chocolate box contains $B_i$ chocolates. Your task is to choose **exactly one** box of candies and **exactly one** box of chocolates. You wi
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