description: 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).
solution: import java.io.BufferedWriter;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStreamWriter;
  
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.Iterator;
  import java.util.LinkedList;
  import java.util.PriorityQueue;
  import java.util.Map.Entry;
  
  
  import java.util.Random;
  import java.util.TreeSet;
  
  public final class CF_750_D2_B
  {
  
  
  	static boolean verb=true;
  	static void log(Object X){if (verb) System.err.println(X);}
  	static void log(Object[] X){if (verb) {for (Object U:X) System.err.print(U+" ");System.err.println("");}}
  	static void log(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");System.err.println("");}}
  	static void logWln(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");}}
  	static void log(int[] X,int L){if (verb) {for (int i=0;i<L;i++) System.err.print(X[i]+" ");System.err.println("");}}
  	static void log(long[] X){if (verb) {for (long U:X) System.err.print(U+" ");System.err.println("");}}
  
  	static void logWln(Object X){if (verb) System.err.print(X);}
  	static void info(Object o){	System.out.println(o);}
  	static void output(Object o){outputWln(""+o+"\n");	}
  	static void outputFlush(Object o){try {out.write(""+ o+"\n");out.flush();} catch (Exception e) {}}
  	static void outputWln(Object o){try {out.write(""+ o);} catch (Exception e) {}}
  
  
  	static void logBin(int[] tm) {for (int x:tm) logWln(bin(8,x)+" ");log("");}
  
  	static String bin(int L,int x) {
  		String s=Integer.toBinaryString(x);
  		while (s.length()<L) s="0"+s;
  		return s;
  	}
  
  	// Global vars
  	static BufferedWriter out;
  	static InputReader reader;
  
  
  	static void test() {
  		log("testing");
  
  		Random r=new Random();
  		int NTESTS=1000000;
  		int NMAX=6;
  		int VMAX=10;
  		for (int t=0;t<NTESTS;t++) {
  
  
  		}
  		log("testing done");
  
  	}
  
  
  
  
  	static int solve(int a,int b) {
  		if (b%2==0) {
  			return a%2;
  		}
  		if (a==0)
  			return 2;
  		return a%2;
  		
  	}
  	
  	
  
  	static void process() throws Exception {
  
  		log("hello");
  
  		//test();
  		out = new BufferedWriter(new OutputStreamWriter(System.out));
  		reader = new InputReader(System.in);
  
  		int T=reader.readInt();
  		for (int t=0;t<T;t++) {
  			int n=reader.readInt();
  			int[] a=new int[n];
  			int zer=0;
  			int ones=0;
  			long bob=1;
  			for (int i=0;i<n;i++) {
  				a[i]=reader.readInt();
  				if (a[i]==0) {
  					bob*=2;
  					zer++;
  				}
  				if (a[i]==1)
  					ones++;
  			}
  			long ans=ones*bob;
  			output(ans);
  		}
  
  		try {
  			out.close();
  		} catch (Exception Ex) {
  		}
  
  
  	}
  
  
  
  
  
  	public static void main(String[] args) throws Exception {
  		process();
  
  	}
  
  	static final class InputReader {
  		private final InputStream stream;
  		private final byte[] buf = new byte[1024];
  		private int curChar;
  		private int numChars;
  
  		public InputReader(InputStream stream) {
  			this.stream = stream;
  		}
  
  		private int read() throws IOException {
  			if (curChar >= numChars) {
  				curChar = 0;
  				numChars = stream.read(buf);
  				if (numChars <= 0) {
  					return -1;
  				}
  			}
  			return buf[curChar++];
  		}
  
  		public final String readString() throws IOException {
  			int c = read();
  			while (isSpaceChar(c)) {
  				c = read();
  			}
  			StringBuilder res = new StringBuilder();
  			do {
  				res.append((char) c);
  				c = read();
  			} while (!isSpaceChar(c));
  			return res.toString();
  		}
  
  		public final String readString(int L) throws IOException {
  			int c = read();
  			while (isSpaceChar(c)) {
  				c = read();
  			}
  			StringBuilder res = new StringBuilder(L);
  			do {
  				res.append((char) c);
  				c = read();
  			} while (!isSpaceChar(c));
  			return res.toString();
  		}
  
  		public final int readInt() throws IOException {
  			int c = read();
  			boolean neg = false;
  			while (isSpaceChar(c)) {
  				c = read();
  			}
  			char d = (char) c;
  			// log("d:"+d);
  			if (d == '-') {
  				neg = true;
  				c = read();
  			}
  			int res = 0;
  			do {
  				res *= 10;
  				res += c - '0';
  				c = read();
  			} while (!isSpaceChar(c));
  			// log("res:"+res);
  			if (neg)
  				return -res;
  			return res;
  
  		}
  
  		public final long readLong() throws IOException {
  			int c = read();
  			boolean neg = false;
  			while (isSpaceChar(c)) {
  				c = read();
  			}
  			char d = (char) c;
  			// log("d:"+d);
  			if (d == '-') {
  				neg = true;
  				c = read();
  			}
  			long res = 0;
  			do {
  				res *= 10;
  				res += c - '0';
  				c = read();
  			} while (!isSpaceChar(c));
  			// log("res:"+res);
  			if (neg)
  				return -res;
  			return res;
  
  		}
  
  		private boolean isSpaceChar(int c) {
  			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
  		}
  	}
  
  }
  