Will India Win
All submissions for this problem are available.
Every one knows that Dhoni is not a superstitious player and believes in team game play and always gives credit to his boys for winning. But as every Indian mother, Dhoni's mother is superstitious and is very upset as her son has retired from test cricket. She wants her son to win this world cup which could be last for him . She visits a fortune teller, the ORACLE. Oracle takes the Jercy number of all the players in Indian team and wants to do certain operation on it. She writes all the number on a piece of paper in binary format, arranges them in order of increasing number of 1's and then takes XOR operation between all the numbers. If the resulting number contains more than X number of 1's then India wins, otherwise India looses. Here X is the date on which the game is to be played.
First line contains the number of test cases.
For each test case first line contains 15 space separated integers, which is the jercy number of each player.
Next line of the test case contains the date X on which day the game is to be played.
Output YES if India will win, otherwise print NO
- 1 ≤ T ≤ 106
- 1 ≤ Jercy No. ≤ 231
- 1 ≤ X ≤ 31
Input: 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 12 Output: NO
|Time Limit:||0.2 - 0.5 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