Reduction Game
CodeChefOpen on judge ↗
You are playing a game called the Reduction Game. This game is played on an array $a$ with $n$ integers. You also have another integer $k$ with you. The following operation will be made repeatedly on this array: - Choose any two elements $a_i, a_j$ such that $i \neq j$, and $min(a_i, a_j) > k$. Decrease both $a_i$ and $a_j$ by one. This operation should be applied to the array if it's possible
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