CWC2015 - CWC-2015

Its cricket world cup 2015. Bangladesh team coach Chandika Hathurusingha wants to choose the best team combination for the world cup. But there are so many options, because there are so many good qualified and experienced players. So he plans several steps for choosing the best team combination. The first step is, he divided N player in two groups such that each group has the same number of players. And sum of players experience of both groups will be same. But doing this he saw it is a very difficult task. Now Chandika Hathurusingha needs your help. He know that you are a good programmer. He gives you list of N player name and experience. You have to find out, is it possible to doing this first step according to his plan.

Input

Input start with an integer (T ≤ 100). Which denotes the number of test cases. Each test case starts with an integer (1 ≤ N ≤ 40) which denotes the number of players in the list. Then next line will be N space separated integers (1 ≤ x ≤ 1000000), which is each player's experience.

Output

For each case, print the case number and if possible print “Yes” or if not possible print “No”.

Example

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

Output:
Case 1: No
Case 2: Yes

Problem Setter: Tanvir Hasan Anick


Added by:Najmuzzaman
Date:2015-04-08
Time limit:5s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 JS-MONKEY

hide comments
2019-06-26 23:08:30
Can you please tell me where I am going wrong ?
#23981064
2016-06-27 18:34:57
4.85 sec !! AC !! :(
2016-05-22 14:25:23
got to learn "meet in the middle" algo
2016-04-09 08:58:00 Safayet Islam Anonno
It doesn't matter whether the input is sorted or not.
Meet in the middle + Binary Search = AC.

Last edit: 2016-04-09 08:58:24
2015-07-24 17:42:41 Ravi kumar
and finally AC after so many WA :)

@all Given array may not be sorted and you have to include all players. Enjoy :)

Last edit: 2015-07-24 17:44:49
2015-07-21 18:36:26 Scape
@Problem-setter, stop telling others to read the problem when the problem is certainly not clear. It is nowhere mentioned in the problem statement whether some player can be left out or not. Please clarify and be more specific.

ans -> You should be use all the player.

Last edit: 2015-10-04 20:56:43
2015-07-02 14:23:51 Bharat Choudary
Can you please tell me where I am going wrong ?
#14585873

ans -> Check Your Code. Some Case is given RE for Line 34 and 35

Yeah, Found the mistake , but still WA. #14630593.
Some tricky test cases please ?

Last edit: 2015-07-09 08:27:52
2015-06-23 10:21:29 Pranjal Shankhdhar
Can some players be left out?

ans -> no you must be use all the player.

Last edit: 2015-10-04 20:57:32
2015-05-24 17:00:32
is the array sorted????

ans-> Read the Problem Statement

Last edit: 2015-07-08 20:40:00
2015-05-24 17:00:27
is the array sorted
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.