Spider-Man Collects Chocolates (Hard Version)
CodeChefOpen on judge ↗
This is the hard version of the previous problem (Spider-Man Collects Chocolates (Easy Version)). Spider-Man participated in a game having $N$ chocolate machines arranged in a row. There, if his web falls on the $i^{th}$ machine, then $A_i$ amount of chocolates will be generated. In the game, he is allowed to throw his web exactly **thrice** and the size of each of his web is exactly $K$ (it 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