Prateek in war
CodeChefOpen on judge ↗
After a lot of years of hardships, Prateek has gathered a mighty army of soldiers. You as his advisor must help him in developing a strategy for battle. The no of soldiers in Prateek's army is N and the strength of the ith soldier is Ai. Prateek always sends his soldiers in pairs. So he can send ith and jth soldiers together given i ≠ j. The cumulative strength of this pair of soldiers would be 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