Given an array A of N integers. You have a set S which contains all possible subsequence's sum of the Array A.
Your task is to find out the MEX(S).
a subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
MEX(S) = Minimum element which is not present in the set.
for eg: MEX(0,1,3,4,6) = 2 (2 is the minimum number which is not present in the set).
Input:
The first line contains the number of test cases t.
The first line of each test case contains the number of elements - N
The second line of each test case contains N integers - the elements of the Array A.
The Sum of N over all test case doesn't exceed 2∗105.
Output:
For each test case print MEX(S).
Constraints:
1≤T≤1001≤N≤2∗1051≤A[i]≤108
Here all possible subsequences are {} {2} {1} {3} {2,1} {2,3} {1,3} {2,1,3}.
so set S= {0,2,1,3,3,5,4,6}
so MEX(S) = 7.