← All problemsSign in

Array Maximization

Given two arrays $A = \{a_1, a_2, ..., a_n\}$ and $B = \{b_1, b_2, ..., b_n\}$ each containing $n$ integers. At each unit time, every $a_i$ gets decreased by $b_i$, and then Alice puts an integer from array $A$ to set $C$ (which is initially empty), and erases the corresponding element from array $B$. This process repeats until arrays $A$ and $B$ are empty. Alice needs to find out the maximum sum

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start