Junseok's Candy Shopping
Time limit1sMemory limit1024 MB
Given N bags of candy, find the largest even total you can get by choosing any subset of bags, or 0 if none exists.
Problem
Junseok wants to take as many candies as possible from the candy shop for his two younger siblings. The shop has bags of candy, and the -th bag holds candies. Junseok is rich, so he can buy as many bags as he wants. However, if the total number of candies he takes is odd, his siblings will fight over who gets one more, so he wants to take an even number of candies. Find the maximum number of candies Junseok can take.
Input
The first line contains the number of bags (). The second line contains (). All numbers in the input are integers.
Output
Print the maximum number of candies Junseok can take. If he can take candies only in an odd total, print .