Summation over nCr

All submissions for this problem are available.
"I'm a fan of anything that tries to replace actual human contact."  Sheldon. After years of hard work, Sheldon was finally able to develop a formula which would diminish the real human contact. He found $k$ integers $n_1,n_2...n_k$ . Also he found that if he could minimize the value of $m$ such that $\sum_{i=1}^k$^{$n$$i$}$C$_{$m$$i$} is even, where $m$ = $\sum_{i=1}^k$$m_i$, he would finish the real human contact. Since Sheldon is busy choosing between PS4 and XBOXONE, he want you to help him to calculate the minimum value of $m$. ###Input:  The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.  The first line of each test case contains a single integer $k$.  Next line contains k space separated integers $n_1,n_2...n_k$ . ###Output: For each test case output the minimum value of m for which $\sum_{i=1}^k$^{$n$$i$}$C$_{$m$$i$} is even, where $m$=$m_1$+$m_2$+. . . $m_k$ and $0$ <= $m_i$<= $n_i$ . If no such answer exists print 1. ###Constraints  $1 \leq T \leq 1000$  $1 \leq k \leq 1000$  $1 \leq n_i \leq 10$^{$18$} ###Sample Input: 1 1 5 ###Sample Output: 2 ###EXPLANATION: ^{$5$}$C$_{$2$} = 10 which is even and m is minimum.Author:  aditya10_ 
Editorial  https://discuss.codechef.com/problems/SUMNCR 
Tags  aditya10_, aditya10_, easymedium, implementation, observations, pelt2019 
Date Added:  25122018 
Time Limit:  1.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, rust, SCALA, swift, 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, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions