Inequality Reduction
CodeChefOpen on judge ↗
There are $n$ friends. The $i^{\text{th}}$ friend has $A_i$ coins. You are also given an integer $R$. Define a transaction as the transfer of one coin from one friend to another. They can do as many transactions as they want under the constraint that: - For any ordered pair of friends $i$ and $j$, the number of transactions from $i$ to $j$ doesn't exceed $R$. What is the maximum possible number
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