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.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.StringTokenizer;
  
  public class MainB {
      private static final FastReader fs = new FastReader();
      private static final PrintWriter out = new PrintWriter(System.out);
      private static long m = 1_000_000_009;
      private static long p = 31;
      private static long mod = 1_000_000_007;
      private static long ool = 1_000_000_000_000_000_009l;
      private static int ooi = 1_000_000_009;
  
      private static void solve() {
          int n = fs.nextInt();
          int[] a = fs.readintarray(n);
          int zero = 0, one = 0;
          for(int i = 0; i < n; i++){
              if(a[i] == 0) zero += 1;
              if(a[i] == 1) one += 1;
          }
          long ans = (long) one * (long) (power(2l, zero));
          out.println(ans);
      }
  
      public static void main(String[] args) {
          Thread t = new Thread(null, null, "", 1 << 28) {
              public void run() {
                  int test_case = 1;
                  test_case = fs.nextInt();
                  for (int cs = 1; cs <= test_case; cs++)
                      solve();
                  out.close();
              }
          };
          t.start();
          try {
              t.join();
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
      }
  
      private static 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;
          }
  
          int[] readintarray(int n) {
              int res[] = new int[n];
              for (int i = 0; i < n; i++)
                  res[i] = nextInt();
              return res;
          }
  
          long[] readlongarray(int n) {
              long res[] = new long[n];
              for (int i = 0; i < n; i++)
                  res[i] = nextLong();
              return res;
          }
      }
  
      public static class DSU {
          List<Integer> par, size;
  
          public DSU(int n){
              par = new ArrayList<>();
              size = new ArrayList<>();
              for(int i = 0; i < n; i++) {
                  par.add(i);
                  size.add(1);
              }
          }
  
          public int getPar(int node){
              par.set(node, node == par.get(node) ? node : getPar(par.get(node)));
              return par.get(node);
          }
  
          public void merge(int u, int v){
              u = getPar(u);
              v = getPar(v);
              if(u == v) return;
              if(size.get(u) >= size.get(v)){
                  par.set(v, u);
                  size.set(u, size.get(u) + size.get(v));
              }else{
                  par.set(u, v);
                  size.set(v, size.get(u) + size.get(v));
              }
          }
      }
  
      private static int max(int... arg) {
          int length = arg.length;
          if(length == 0)
              throw null;
          int maxVal = arg[0];
          for(int i = 1; i < length; i++)
              maxVal = Math.max(maxVal, arg[i]);
          return maxVal;
      }
  
      private static int min(int... arg) {
          int length = arg.length;
          if(length == 0)
              throw null;
          int maxVal = arg[0];
          for(int i = 1; i < length; i++)
              maxVal = Math.min(maxVal, arg[i]);
          return maxVal;
      }
  
      private static long max(long... arg) {
          int length = arg.length;
          if(length == 0)
              throw null;
          long maxVal = arg[0];
          for(int i = 1; i < length; i++)
              maxVal = Math.max(maxVal, arg[i]);
          return maxVal;
      }
  
      private static long min(long... arg) {
          int length = arg.length;
          if(length == 0)
              throw null;
          long maxVal = arg[0];
          for(int i = 1; i < length; i++)
              maxVal = Math.min(maxVal, arg[i]);
          return maxVal;
      }
  
      private static int abs(int a) {
          return a >= 0 ? a : -a;
      }
  
      private static int abs(int a, int b) {
          return a-b >= 0 ? a-b : b-a;
      }
  
      private static long abs(long a) {
          return a >= 0 ? a : -a;
      }
  
      private static long abs(long a, long b) {
          return a-b >= 0 ? a-b : b-a;
      }
  
      private static int power(int base, int exponent) {
          int res = 1;
          while(exponent > 0) {
              if((exponent & 1) != 0)
                  res *= base;
              exponent >>= 1;
              base *= base;
          }
          return res;
      }
  
      private static long power(long base, long exponent) {
          long res = 1;
          while(exponent > 0) {
              if((exponent & 1) != 0)
                  res *= base;
              exponent >>= 1;
              base *= base;
          }
          return res;
      }
  
      private static long mPower(long base, long exponent) throws Exception {
          long res = 1;
          base %= mod;
          while(exponent > 0) {
              if((exponent & 1) != 0)
                  res = mul(res, base);
              exponent >>= 1;
              base = mul(base, base);
          }
          return res;
      }
  
      private static long mul(long a, long b) {
          return a*b % mod;
      }
  
      private static long add(long a, long b) {
          return (a+b) % mod;
      }
  
      private static long sub(long a, long b) {
          long res = (a - b) % mod;
          if(res < 0)
              res += mod;
          return res;
      }
  
      private static long xor(long n){
          long r = n % 4;
          if(r == 0)
              return n;
          else if(r == 1)
              return 1;
          else if(r == 2)
              return n+1;
          else
              return 0;
      }
  }