CWC2015 - CWC-2015

no tags 

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 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.


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


1 2 3 4 5 6
2 3 4 5

Case 1: No
Case 2: Yes

Problem Setter: Tanvir Hasan Anick

hide comments
dragonsan17: 2019-06-26 23:08:30

Can you please tell me where I am going wrong ?

anuj0503: 2016-06-27 18:34:57

4.85 sec !! AC !! :(

aspro: 2016-05-22 14:25:23

got to learn "meet in the middle" algo

Safayet Islam Anonno: 2016-04-09 08:58:00

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
Ravi kumar: 2015-07-24 17:42:41

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
Scape: 2015-07-21 18:36:26

@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
Bharat Choudary: 2015-07-02 14:23:51

Can you please tell me where I am going wrong ?

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
Pranjal Shankhdhar: 2015-06-23 10:21:29

Can some players be left out?

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

Last edit: 2015-10-04 20:57:32
mani_mckinnon: 2015-05-24 17:00:32

is the array sorted????

ans-> Read the Problem Statement

Last edit: 2015-07-08 20:40:00
mani_mckinnon: 2015-05-24 17:00:27

is the array sorted

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