Company: Amazon
Difficulty: easy
A logistics hub employs n delivery agents. Agent i has already been handed parcels[i] parcels for the day, and these parcels cannot be taken away from that agent or moved to another agent. A further extra_parcels parcels arrive at the hub. Every one of them must be handed to some agent , and each extra parcel may go to any agent (an agent may receive any number of extra parcels, including none). The workload of an agent is the total number of parcels that agent ends up delivering. Distribute all of the extra parcels so that the largest workload among the n agents is as small as possible. Given parcels and extra_parcels , print the minimum possible value of the maximum number of parcels any single agent must deliver. Input Format The first line contains an integer n , the number of delivery agents. Each of the next n lines contains an integer parcels[i] . The last line contains an integer extra_parcels . Output Format Print a single integer: the minimum possible value of the maximum wor