import java.util.Arrays;

class Main {
  public static void main(String[] args) {
    In in = new In();
    Out out = new Out();
    out.SysInit(); 
    test(in, out);
  }
  
  public static void test(In in, Out out) {
    // Uncomment the following two lines if you want to read from a file
    in.open("public/custom.in");
    out.compareTo("public/custom.out");
    
    int testNum = in.readInt(); // read the number of tests
    for (int i = 0; i < testNum; i++) {
      int arrLength = in.readInt();
      int[] A = new int[arrLength];
      for (int j=0; j<arrLength; j++) {
        A[j] = in.readInt();
      }
      boolean res = partition(A);
      out.println(res);
    }
  }
  
  public static boolean partition(int[] A) {
    int n = A.length;
    int total = 0;
    
    // Compute total sum of all elements
    for (int i=0; i<n; i++) {
      total += A[i];
    }
    
    // Pre-check for oddness (careful with java floor division)
    if (total % 2 == 1) {
      return false;
    }
    
    // total / 2 is the target value we want to reach => partition possible
    int s_max = total / 2;
    boolean[][] DP = new boolean[n+1][s_max+1];
    
    // Base cases
    DP[0][0] = true;
    for (int i=1; i<n+1; i++) {
      DP[i][0] = true;
    }
    
    // Recursion
    for (int sum=1; sum<=s_max; sum++) {
      for (int i=1; i<n+1; i++) {
        // Can I solve it with A[1...i-1]?
        DP[i][sum] = DP[i][sum] || DP[i-1][sum];
        // Or take a_i and check if I can get to sum using the
        // first i-1 elements (DP[i-1][sum-a_i] tells me if this is possible)
        if (A[i-1] <= sum) DP[i][sum] = DP[i][sum] || DP[i-1][sum-A[i-1]];
      }
    }
    
    // Extract solution: DP[n][s_max] = Can I achieve a sum of s_max 
    // with a subset from the first n elements
    // Note: The complement of that set also sums to s_max => partition found!
    return DP[n][s_max];
  }
}