QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 256 MB مجموع النقاط: 10

#6040. 零花钱 [B]

الإحصائيات

零花钱发放的时间到了。妈妈对 Bajtek 和 Bajtolina 打扫房间的表现感到非常高兴。她决定从钱包里拿出一些纸币作为零花钱,但必须保证孩子们能够平分这些钱。妈妈没有时间去兑换零钱,也不想进行多余的讨论——如果有必要,孩子们自己会在报刊亭把收到的纸币换成零钱。

Bajtocja 的官方货币是 bajtalar。最小的面额是 1 bajtalar。因此,当且仅当总金额 $b$ 为偶数时,这 $b$ 个 bajtalar 才能被两个人平分。

输入格式

输入的第一行包含一个整数 $n$ ($1 \le n \le 1\,000\,000$),表示妈妈钱包里的纸币数量。第二行包含 $n$ 个整数 $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 1000$),表示这些纸币的面额。

输出格式

输出妈妈可以作为零花钱发放的纸币面额之和的最大值,使得孩子们能够平分这笔钱。

如果无法从钱包中选出任意数量的纸币(至少一张)来满足该条件,妈妈就不得不去自动取款机取钱。在这种情况下,请输出单词 NIESTETY

样例

输入 1

5
2 4 3 3 3

输出 1

12

输入 2

1
5

输出 2

NIESTETY

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.