MAJOR - Majority

The human tribe has just discovered some other tribe and wants to communicate with them. To make sure it is not intercepted by the terminators, they ask their chief computer engineer Rohit to design a system for the purpose. In the design that Rohit proposes, data is transmitted n times. If it is received more than half-the times, it is said to be successfully transmitted. If not, the data is said to be lost. Rohit obviously got a lot of fame and respect for his work. Nitish doesn’t like it and wants to challenge Rohit’s supremacy. He wants to check out the system and has hired you for the process.

Input

The first line of the input contains test cases t (1 <= t <= 100). It is followed by 2*t lines, 2 for each test case. The first line of input for each test case contains a number n (0 <= n <= 106), followed by n elements in the next line. Each number is from -10^3 to +10^3

Output

You are required to output ‘YES’ followed by the number transmitted, if it was transmitted successfully, and ‘NO’ otherwise.

Example

Input:
3
4
2 1 2 2
6
1 1 1 2 2 2
5
1 2 4 5 1

Output:
YES 2
NO
NO

Added by:Troika::Bytes
Date:2010-02-18
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: PERL6

hide comments
2015-01-08 21:13:27 no name
just a waste of time -_-
2015-01-08 11:06:25 abhi
Finally ac!..lot of WA cuz of my stupid mistake..didnt leave line aftr every o/p.-_-
2014-12-31 11:36:55 :.Mohib.:
NicE....!!!
2014-01-28 21:23:45 sourav
SIGSEV error.Please help
2014-01-01 13:11:16 Ankit Jain
cakewalk..:)
2014-01-01 09:08:16 ABHISHEK004
done using map...
and also simply using array....
both accepted :)
2013-12-16 17:01:15 Sayan Paul
My Century !! :)
2013-09-09 06:48:35 Ayush
I am getting SIGSEGV( runtime problem). I got the same error while submitting other problems also. Please help. I am new to programming.
2013-09-03 17:32:50 Ishan Bansal
how did I get AC in 2.12 sec
2013-09-01 08:50:09 Unknown
My 100 on spoj..
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.