Company: wayfair_26oct
Difficulty: medium
Discount Tags Problem Description A shop runs a puzzle for its discount coupons. There are n tags, and tag i carries the value val[i] . A customer picks any set of the tags; the coupon is valid only when the sum of the picked values is even . Tag values can be positive, zero or negative, and the customer is allowed to pick no tags at all (the empty set has sum 0 , which is even). At least one tag has an even value. Complete the function getMaximumEvenSum(val) , which returns the largest even sum that a set of tags can have. Input Format Read from standard input. n val[0] val[1] ... val[n-1] The first line contains an integer n , the number of tags. Each of the next n lines contains one integer val[i] . Output Format Print a single integer: the maximum even sum of a set of tags. Constraints 1 <= n <= 15000 (inferred -- the source states n <= 10^5 , which cannot fit within the judge's input size limit with values of this size; this bound keeps every input under it.) -10^9 <=