Equal Balances
CodeChefOpen on judge ↗
The company Alco works in has accounts in N different banks. Assume the banks to be placed on a single line, unit length apart. The ith bank account contains a balance of Ai. A transaction of x units from bank i to bank j can be made if bank i has sufficient balance (i.e., the balance of bank account i is greater than or equal to x), and the cost of such a transaction will be x*d, where d is the
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