#C380. Minimum Melting Days

    ID: 47267 Type: Default 1000ms 256MiB

Minimum Melting Days

Minimum Melting Days

You are given a list of positive integers representing the heights of candles. Each candle requires a number of days to melt completely. The melting process is such that the melting capacity on any day is equal to the height of the shortest candle in the list plus one additional unit. However, it turns out that the minimum number of days required to melt all the candles is directly equal to the height of the tallest candle. Your task is to write a program that computes the minimum number of days needed to melt all the candles.

Note: Although the narrative mentions a melting process, it can be shown mathematically that the minimum number of days required is given by:

days=max1in(hi)\text{days} = \max_{1 \leq i \leq n} (h_i)

where \( h_i \) is the height of the \( i^{th} \) candle.

inputFormat

The first line contains a single integer \( n \) indicating the number of candles.

The second line contains \( n \) space-separated positive integers representing the heights of the candles.

outputFormat

Output a single integer representing the minimum number of days required to melt all the candles completely.

## sample
4
4 3 2 1
4