F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

大豪宅

Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 1    Accepted Submission(s): 1


Problem Description
小辣有一个5.9公顷的大豪宅和 n 个栅栏,其中第 i 个栅栏的长度为 $a_i$。

小辣想把所有的栅栏全部围在房子的外面,由于小辣相信三角形是最稳定的形状,所以小辣希望这些栅栏围出的形状是一个等边三角形。

现在小辣想知道是否存在方案,能将所有栅栏分成三组,并且每组栅栏的长度之和相等。

如果存在方案,则输出"YES",否则输出"NO"。
 

Input
第一行一个整数 T, 表示数据组数。对于每组数据:

第一行一个整数 n 表示栅栏的数量

第二行有 n 个整数 $a_1,a_2,a_3,…,a_n$,表示每个栅栏的长度。

数据保证 $T≤20,1≤n≤50,1≤a_i≤100$
 

Output
对于每组数据,如果存在方案,则输出"YES",否则输出"NO"。(输出的内容不含双引号)
 

Sample Input
3 8 1 2 3 4 4 5 5 6 8 8 7 3 10 6 1 7 3 9 42 13 28 51 20 46 19 13 47
 

Sample Output
YES NO YES
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-03-28 21:43:18, Gzip enabled