#K15236. Maximum Food Collection
Maximum Food Collection
Maximum Food Collection
You are given N, the number of houses, and a list of N integers representing the amount of food available in each house. The task is to determine the maximum amount of food that can be collected. According to the rules, two houses can only combine their food if the sum of their food amounts is an even number, and the same pair of houses cannot be combined more than once. However, after careful analysis, it turns out that the maximum food collection achievable under these conditions is simply the sum of food from all houses.
Task: Compute and output the total sum of the food amounts available in the houses.
Note: The correctness of the solution is ensured by considering several test cases that include all even values, all odd values, and mixed parity.
inputFormat
The input is given via standard input (stdin) and consists of two lines:
- The first line contains a single integer N (1 ≤ N ≤ 105) which denotes the number of houses.
- The second line contains N space-separated integers representing the food available at each house. Each food amount is a non-negative integer.
outputFormat
Output a single integer representing the maximum amount of food that can be collected.
## sample5
2 4 6 8 10
30
</p>