SHINCHAN AND ACE
All submissions for this problem are available.
Shinchan and Ace are becoming very popular in COUNTER STRIKE. They are known for their good coordination.
Nowadays, they are playing together. There are N terrorist and each terrorist has a strength associated with it. They have to kill all the terrorists. They have to follow the following rules:
They want to know whether they will be able to kill all the terrorists at the same time or not. Now, they want your help to maintain their coordination.
First line of the input contains an integer T denoting the number of test cases.
First line of each test case contains an integer N denoting the number of terrorists. Next line contains N space separated integers A1, A2, ..., AN denoting the strength of the terrorists.
Output YES if Shinchan and Ace can kill all the terrorist at the same time,
- 1 ≤ T ≤ 10
- 1 ≤ N ≤ 500
- 1 ≤ Ai ≤ 500
1 7 5 3 9
7 12 4 9
Example case 1. Ace and Shinchan can never kill all the enemies at the same time.
Example case 2. Shinchan chooses terrorists with strength 12 and
4 and takes total time = 16. Ace chooses terrorists with strength
7 and 9 and takes total time = 16. Hence both of them take equal time and
kill the enemies at the same time, that is after 16 units of time.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions