#C5668. Minimum Shelves Required
Minimum Shelves Required
Minimum Shelves Required
You are given n types of action figures. For each type, you are provided with the number of figures available. In order to display these figures, you can place one figure of each type per shelf. Therefore, the minimum number of shelves required to display all the figures is equal to the maximum number of figures among any type.
For example, if you have 3 types with counts [2, 3, 1], you will need 3 shelves, because the second type requires 3 spots.
Solve this problem by determining the maximum value from the provided list of figure counts.
inputFormat
The input is given via the standard input (stdin) and consists of two lines:
- The first line contains one integer n, representing the number of different types of action figures.
- The second line contains n space-separated integers, where each integer represents the number of figures of a particular type.
outputFormat
Output a single integer to the standard output (stdout), which is the minimum number of shelves required. This value is equal to the maximum count among the given figures.
## sample3
2 3 1
3