#C6579. Maximum Candy Distribution Rounds
Maximum Candy Distribution Rounds
Maximum Candy Distribution Rounds
You are given N jars, each containing a certain number of candies. Your task is to determine the maximum number of rounds Jack can distribute the candies, where in each round Jack distributes one candy from any jar. In other words, simply compute the total number of candies available. Mathematically, if the number of candies in the ith jar is \( candy_i \), you need to compute:
[ \text{Total Rounds} = \sum_{i=1}^{N} candy_i ]
Input and output are through standard input (stdin) and standard output (stdout) respectively.
inputFormat
The first line contains a single integer N (1 ≤ N ≤ 106), representing the number of jars.
The second line contains N space-separated integers, where the ith integer denotes the number of candies in the ith jar (0 ≤ candyi ≤ 106).
outputFormat
Output a single integer which is the total number of candies. This represents the maximum number of rounds Jack can distribute candies.
## sample5
2 3 1 4 0
10
</p>