STRENGTH OF THE ARMY
CodeChefOpen on judge ↗
An army of $N$ soldiers is present on the field, the ith soldier has $A[i]$ power. Colonel wants to arrange the soldiers in a forces such that size of each force should be between $X$ to $Y$ and each soldier can be present in $at$ $most$ $one$ $force$. Let's say arranged forces are $F(1), F(2), ...., F(M)$. Then Strength of the army can be calculated as sum of the average power of each fo
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