#A. 最大偶数和

    Type: Default 1000ms 256MiB

最大偶数和

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

最大偶数和

题目描述

给定 nn 个数,请从中选出若干个数,使得总和为偶数。

请最大化这个总和。当然你可以一个都不选。

输入格式

第一行包含一个正整数 nn

第二行包含 nn 个正整数a1,a2,...,ana_1,a_2,...,a_n

输出格式

输出一个正整数,即最大的总和。

样例 #1

样例输入 #1

5
2 4 3 3 3

样例输出 #1

12

提示

40%40\%的数据,n5000n\le 5000, ai1000a_i\le 1000

100%100\%的数据,1n1061\le n\le 10^61ai1091\le a_i\le 10^9

2023上学期初一竞赛组期末考

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2023-12-25 14:30
End at
2023-12-26 16:51
Duration
26.4 hour(s)
Host
Partic.
39