#K94152. Minimum Time Units for Problem Solving
Minimum Time Units for Problem Solving
Minimum Time Units for Problem Solving
There are n participants in a coding contest. Each participant has a set number of problems to solve. In each time unit, every participant can solve at most one problem, with the condition that no two participants solve the same problem simultaneously.
The objective is to determine the minimum total number of time units required for all participants to complete all of their problems. Since each participant can work on a problem at the same time independently, the answer is equal to the maximum number of problems any single participant needs to solve.
In mathematical terms, given an integer \( n \) and a list \( p = [p_1, p_2, \dots, p_n] \), the minimum time required is calculated as:
\( T = \max(p) \)
inputFormat
The first line of input contains an integer \( n \) representing the number of participants.
The second line contains \( n \) space-separated integers, where the \( i \)-th integer represents the number of problems participant \( i \) needs to solve.
\( 1 \leq n \leq 10^5 \) and each participant's problem count is between \( 1 \) and \( 10^9 \).
outputFormat
Output a single integer, the minimum total number of time units required for all participants to complete their problems.
## sample3
2 3 3
3
</p>