QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 512 MB Points totaux : 100

#16213. 分赃

Statistiques

一支实力强劲的算法竞赛队伍可以积累大量的奖金。鉴于你们队伍的强大实力,你们肯定会赢得许多比赛,因此你最好现在就坐下来,确认每个人最终都能公平地分到相同数额的奖金。

你们将参加多场比赛,并在每场比赛结束时获得固定金额的奖金。每次你可以将任意金额分配给队伍中的三名成员,但到最后,每个人的总奖金数额必须相同。

你是否能够合理分配奖金,使得最终每个人分到的总金额相等?

输入格式

  • 第一行包含一个整数 $n$ ($1 \le n \le 10^4$),表示比赛的数量。
  • 第二行包含 $n$ 个整数 $w_1 \dots w_n$ ($1 \le w_i \le 10^5$),表示每场比赛的奖金金额。

输出格式

如果奖金可以平分给三位参赛队员,输出 yes,否则输出 no

样例

输入样例 1

2
10 3

输出样例 1

no

输入样例 2

3
9 8 7

输出样例 2

yes

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.