QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 10

#6040. Pocket Money [B]

Statistics

It is time for pocket money distribution. Mom is delighted with how Bajtek and Bajtolina cleaned their room. She has decided to allocate some of the banknotes from her wallet for pocket money, in such a way that the children will be able to split the money equally. Mom does not have time for exchanging money or unnecessary discussions – if needed, the children will exchange the received banknotes themselves at a kiosk.

The official currency of Bajtocja is the bajtalar. The smallest available denomination is 1 bajtalar. Therefore, an amount of $b$ bajtalars can be split equally between two people if and only if $b$ is even.

Input

The first line of input contains a single integer $n$ ($1 \le n \le 1\,000\,000$) representing the number of banknotes in Mom's wallet. The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 1000$) representing the denominations of these banknotes.

Output

Output the maximum sum of the denominations of the banknotes that Mom can allocate for pocket money so that the children can split the received amount equally.

If it is impossible to choose any positive number of banknotes from the wallet such that this condition is met, Mom must unfortunately go to an ATM. In such a case, output the word NIESTETY.

Examples

Input 1

5
2 4 3 3 3

Output 1

12

Input 2

1
5

Output 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.