// Arup Guha
// 4/5/2018
// Example for COP 35035: Fewest # of coins to make change for n cents.

import java.util.*;

public class fewestcoins {

	public static int n;
	public static int[] denom;
	public static int amtChange;

	final public static boolean DEBUG = false;
	final public static boolean REG = true;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();

		// Process each case.
		for (int loop=0; loop<nC; loop++) {

			n = stdin.nextInt();
			amtChange = stdin.nextInt();
			denom = new int[n];

			// Read in denominations.
			for (int i=0; i<n; i++)
				denom[i] = stdin.nextInt();

			// Solve it!
			if (REG)
				System.out.println(minCoins());
			else
				System.out.println(minCoinsAltAlg());
		}
	}

	public static int minCoins() {

		int[] dp = new int[amtChange+1];
		Arrays.fill(dp, -1);
		dp[0] = 0;

		// Calculate for each possible amount of change.
		for (int i=1; i<=amtChange; i++) {

			// Try giving one copy of each coin.
			for (int j=0; j<n; j++) {

				// Can't have this coin, it's worth too much, or we can't build off of this.
				if (i-denom[j] < 0 || dp[i-denom[j]] == -1) continue;

				// This answer is better, update.
				if (dp[i] == -1 || dp[i-denom[j]] + 1 < dp[i])
					dp[i] = dp[i-denom[j]] + 1;
			}
		}

		// Print out final answers.
		if (DEBUG) {
			for (int i=0; i<=amtChange; i++)
				System.out.print(i+"\t");
			System.out.println();
			for (int i=0; i<=amtChange; i++)
				System.out.print("--\t");
			System.out.println();
			for (int i=0; i<=amtChange; i++)
				System.out.print(dp[i]+"\t");
			System.out.println();
		}

		// This is our result.
		return dp[amtChange];
	}

	// Alternate DP algorithm where the order of the loops is change. We try each coin one at a time
	// updating our answer for each possible # of cents while we consider a single coin.
	public static int minCoinsAltAlg() {

		int[] dp = new int[amtChange+1];
		Arrays.fill(dp, -1);
		dp[0] = 0;

		// Chart header.
		if (DEBUG) {
			for (int i=0; i<=amtChange; i++)
				System.out.print(i+"\t");
			System.out.println();
			for (int i=0; i<=amtChange; i++)
				System.out.print("--\t");
			System.out.println();
		}

		// Try adding each new coin.
		for (int j=0; j<n; j++) {

			// Calculate for each possible amount of change.
			for (int i=denom[j]; i<=amtChange; i++) {

				// Not a valid subset to build off of.
				if (dp[i-denom[j]] == -1) continue;

				// This answer is better, update.
				if (dp[i] == -1 || dp[i-denom[j]] + 1 < dp[i])
					dp[i] = dp[i-denom[j]] + 1;
			}

			// See what our results look like after adding in coin j.
			if (DEBUG) {
				for (int i=0; i<=amtChange; i++)
					System.out.print(dp[i]+"\t");
				System.out.println();
			}

		}

		// This is our result.
		return dp[amtChange];
	}

}