Company: Opentext_13nov
Difficulty: medium
Account Balance After Donations Problem An NGO runs an app through which people donate money to families in need. The app holds N accounts with IDs 0 to N - 1 , and account i starts with a balance of balances[i] . M donations arrive, one after another, and the app hands each one to a single account chosen by this rule: the account whose current balance is the lowest receives it; when several accounts are tied for the lowest balance, the one with the smaller ID receives it. The donation is added to that account's balance before the next donation is considered, so every choice is made against the balances as they stand at that moment. Print the balance of every account once all M donations have been handed out. Input Format Line 1: the integer N , the number of accounts. Line 2: N space-separated integers, the starting balances in account-ID order. Line 3: the integer M , the number of donations. Line 4: M space-separated integers, the donation amounts in the order they arrive. This line