Luntik came out for a morning stroll and found an array a of length n. He calculated the sum s of the elements of the array (s= ∑_{i=1}^{n} a_i). Luntik calls a subsequence of the array a nearly full if the sum of the numbers in that subsequence is equal to s-1.

Luntik really wants to know the number of nearly full subsequences of the array a. But he needs to come home so he asks you to solve that problem!

A sequence x is a subsequence of a sequence y if x can be obtained from y by deletion of several (possibly, zero or all) elements.

Input

The first line contains a single integer t (1 ≤ t ≤ 1000) — the number of test cases. The next 2 ⋅ t lines contain descriptions of test cases. The description of each test case consists of two lines.

The first line of each test case contains a single integer n (1 ≤ n ≤ 60) — the length of the array.

The second line contains n integers a_1, a_2, …, a_n (0 ≤ a_i ≤ 10^9) — the elements of the array a.

Output

For each test case print the number of nearly full subsequences of the array.

Example

Input


5
5
1 2 3 4 5
2
1000 1000
2
1 0
5
3 0 2 1 1
5
2 1 0 3 0


Output


1
0
2
4
4

Note

In the first test case, s=1+2+3+4+5=15, only (2,3,4,5) is a nearly full subsequence among all subsequences, the sum in it is equal to 2+3+4+5=14=15-1.

In the second test case, there are no nearly full subsequences.

In the third test case, s=1+0=1, the nearly full subsequences are (0) and () (the sum of an empty subsequence is 0).
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import static java.lang.System.out;
import java.util.*;
import java.io.*;
import java.math.*;
import java.util.Map.Entry;
 
public class MacroTemplates
{
    static class pair
	{
		int s;int e;
		pair(int s,int e)
		{
			this.s=s;
			this.e=e;
		}
	}
    public static void main(String hi[]) throws Exception
    {
        PrintWriter out = new PrintWriter(System.out);
        FastReader ob=new FastReader();
        int T = ob.nextInt();
        StringBuilder sb = new StringBuilder();
        while(T-->0)
        {
           int n=ob.nextInt();
           long arr[]=new long[n];
           for(int i=0;i<n;i++)
           {
               arr[i]=ob.nextLong();
           }
           int one=0;int zero=0;long sum=0;
		for(int i=0;i<n;i++)
		{
			if(arr[i] == 1) {
				one++;
			}
			if(arr[i] == 0) {
				zero++;
			}
			sum+=arr[i];
		}
		if(one == 0) {
			System.out.println("0");
		}
		else {
			if(zero == 0) {
				System.out.println(one);
			}
			else {
				long ans=(long)Math.pow(2, zero)-1;
				if(sum == 1) {
					System.out.println((long)Math.pow(2, zero));
				}
				else {
					System.out.println((ans*one)+one);
				}
			}
		}
	    out.flush();
        }
    }
    static int isCheck(long s)
	{
		 double k = (-1.0 + Math.sqrt(1 + 8 * s)) / 2;
		    
		    
		    if (Math.ceil(k) == Math.floor(k)) {
		    	return (int)k;
		    }
		    else {
		    	return -1;
		    }
	}
    static String middle(int i)
		{
			String str="";
			for(int j=1;j<=i;j++)
			{
				str+="()";
			}
			return str;
		}
	static String start(int i,int n)
		{
			String str="";
			for(int j=1;j<=(n-i);j++)
			{
				str+="(";
			}
			return str;
		}
		static String close(int i,int n)
		{
			String str="";
			for(int j=1;j<=(n-i);j++)
			{
				str+=")";
			}
			return str;
		}
    public static boolean isPrime(long n)
    {
        if(n < 2) return false;
        if(n == 2 || n == 3) return true;
        if(n%2 == 0 || n%3 == 0) return false;
        long sqrtN = (long)Math.sqrt(n)+1;
        for(long i = 6L; i <= sqrtN; i += 6) {
            if(n%(i-1) == 0 || n%(i+1) == 0) return false;
        }
        return true;
    }
    public static long gcd(long a, long b)
    {
        if(a > b)
            a = (a+b)-(b=a);
        if(a == 0L)
            return b;
        return gcd(b%a, a);
    }
    public static ArrayList<Integer> findDiv(int N)
    {
        //gens all divisors of N
        ArrayList<Integer> ls1 = new ArrayList<>();
        ArrayList<Integer> ls2 = new ArrayList<Integer>();
        for(int i=1; i <= (int)(Math.sqrt(N)+0.00000001); i++)
            if(N%i == 0)
            {
                ls1.add(i);
                ls2.add(N/i);
            }
        Collections.reverse(ls2);
        for(int b: ls2)
            if(b != ls1.get(ls1.size()-1))
                ls1.add(b);
        return ls1;
    }
    public static void sort(int[] arr)
    {
        //because Arrays.sort() uses quicksort which is dumb
        //Collections.sort() uses merge sort
        ArrayList<Integer> ls = new ArrayList<Integer>();
        for(int x: arr)
            ls.add(x);
        Collections.sort(ls);
        for(int i=0; i < arr.length; i++)
            arr[i] = ls.get(i);
    }
    public static long power(long x, long y, long p)
    {
        //0^0 = 1
        long res = 1L;
        x = x%p;
        while(y > 0)
        {
            if((y&1)==1)
                res = (res*x)%p;
            y >>= 1;
            x = (x*x)%p;
        }
        return res;
    }
}
class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(
                new InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() { return Integer.parseInt(next()); }
 
        long nextLong() { return Long.parseLong(next()); }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }