import java.util.*;


public class dnc_subset_sum 
{
    
    // Make this false for testing random cases!
    public static boolean from_file = true;
    
    // Random Case generation parameters
    public static int MAX_VAL = 20;
    public static int RANDOM_CASES = 100;
    public static int MAX_RANDOM_SIZE = 30;
    
    // Main function handles IO
    public static void main(String[] Args) 
    {
     
        if (!from_file)
        {
            // ------------------------------------
            //            Random Tests
            // ------------------------------------
            
            // An array for statistics
            int[] frequencies = new int[MAX_RANDOM_SIZE];
            
            // Seed our random number generator
            Random r = new Random(1234);
            
            // Run for each random case
            for (int i = 0; i < RANDOM_CASES; i++) 
            {
                // Values for analyzing statistics on reachabe and unreachable values
                int inCount = 0;
                int outCount = 0; 
                
                // Set a flag to nothing is incorrect
                boolean good = true;
                
                // Make an expanding list of values
                ArrayList<Integer> vals = new ArrayList<Integer>();
                
                // Run up to the max size for random sets
                for (int j = 0; j < MAX_RANDOM_SIZE; j ++) 
                {
                    // Add a value to our set of values
                    vals.add(r.nextInt(MAX_VAL) + 1);
                    
                    // Compute a sum and store values into an array (rather than a list)
                    int sum = 0;
                    int[] val_array = new int[j + 1];
                    for (int k = 0; k <= j; k++) 
                    {
                        sum += (val_array[k] = vals.get(k));
                    }
                    
                    // Generate a target value up to the sum of all values
                    int target = r.nextInt(sum);
                    
                    // Do some analysis for kicks
                    if (isPossibleDNC(val_array, target))
                    {
                        inCount++;
                        frequencies[j]++;
                    }
                    else
                    {
                        outCount++;
                    }
                    
                    // Check the solution was correct
                    if (isPossibleBrute(val_array, target) != isPossibleDNC(val_array, target)) 
                    {
                        good = false;
                        System.err.println(Arrays.toString(val_array) + " " + target);
                    }
                }
                
                // Check if there was no wrong cases
                if (good) 
                {
                    System.out.println("Case #" + (i + 1) + " is good");
                    System.out.println("Number of reachable targets is " + inCount);
                    System.out.println("Number of unreachable targets is " + outCount);
                }
            }
            
            // Just to see how "random" this method is
            System.out.println(Arrays.toString(frequencies));
        }
        else
        {
            // ------------------------------------
            //           Tests from inputs
            // ------------------------------------
            
            Scanner sc = new Scanner(System.in);
            int test_cases = sc.nextInt();
            for (int i = 0; i < test_cases; i++) 
            {
                // Read test Case
                int num = sc.nextInt();
                int target = sc.nextInt();
                int[] values = new int[num];
                for (int j = 0; j < num; j++) 
                {
                    values[j] = sc.nextInt();
                }
                
                // Evaluate test case
                // Change to Brute to test with slower solution
                if (isPossibleDNC(values, target))
                    System.out.println("Target can be reached");
                else
                    System.out.println("Target cannot be reached");
            }
        }
    }
    
    // DNC
    public static boolean isPossibleDNC(int[] values, int target) 
    {
        // Divide
        int[] vs1 = new int[values.length / 2];
        int[] vs2 = new int[values.length - values.length / 2];
        int point = 0;
        for (int i = 0; i < values.length / 2; i++)
            vs1[i] = values[point++];
        for (int i = 0; point < values.length; i++)
            vs2[i] = values[point++];
        
        // Solve
        ArrayList<Integer> potentials1 = dnc(vs1, 0, 0);
        ArrayList<Integer> potentials2 = dnc(vs2, 0, 0);
    
        // Merge (Conquer)
        Collections.sort(potentials1);
        Collections.sort(potentials2);
        int ptr2 = potentials2.size() - 1;
        for (int i = 0; i < potentials1.size(); i++) 
        {
            while (ptr2 > 0 && target < potentials1.get(i) + potentials2.get(ptr2)) 
            {
                ptr2--;
            }
            if (target == potentials1.get(i) + potentials2.get(ptr2)) 
            {
                return true;
            }
        }
        return false;
    }
    
    public static ArrayList<Integer> dnc(int[] a, int pos, int sum) 
    {
        if (pos == a.length)
        {
            ArrayList<Integer> ret = new ArrayList<Integer>();
            ret.add(sum);
            return ret;
        }
        
        ArrayList<Integer> first = dnc(a, pos + 1, sum);
        ArrayList<Integer> second = dnc(a, pos + 1, sum + a[pos]);
        
        second.addAll(first);
        return second;
    }
    
    // Not DNC
    public static boolean isPossibleBrute(int[] values, int target) 
    {
        return brute_force(0, values, target, 0);
    }
    
    // Not DNC
    public static boolean brute_force(int position, int[] values, int target, int sum) 
    {
        // Check if our sum is the target
        if (sum == target)
            return true;
        
        // Check if our sum is greater than the target
        if (sum > target)
            return false;
        
        // Check if we have no more values to add
        if (position == values.length)
            return false;
        
        // Try not adding the current value
        if (brute_force(position + 1, values, target, sum))
            return true;
        
        // Try adding the current value
        return brute_force(position + 1, values, target, sum + values[position]);
    }
}