CF621A.Wet Shark and Odd and Even

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Today, Wet Shark is given nn integers. Using any of these integers no more than once, Wet Shark wants to get maximum possible even (divisible by 22 ) sum. Please, calculate this value for Wet Shark.

Note, that if Wet Shark uses no integers from the nn integers, the sum is an even integer 00 .

输入格式

The first line of the input contains one integer, nn ( 1<=n<=1000001<=n<=100000 ). The next line contains nn space separated integers given to Wet Shark. Each of these integers is in range from 11 to 10910^{9} , inclusive.

输出格式

Print the maximum possible even sum that can be obtained if we use some of the given integers.

输入输出样例

  • 输入#1

    3
    1 2 3
    

    输出#1

    6
  • 输入#2

    5
    999999999 999999999 999999999 999999999 999999999
    

    输出#2

    3999999996

说明/提示

In the first sample, we can simply take all three integers for a total sum of 66 .

In the second sample Wet Shark should take any four out of five integers 999999999999999999 .

首页