// Arup Guha
// 3/21/2023
// Solution to Kattis Problem: Bag of Tiles
// https://open.kattis.com/problems/bagoftiles

import java.util.*;

public class bagoftiles {

	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		
		// Process cases.
		for (int loop=1; loop<=nC; loop++) {
		
			// Read in tile values.
			int n = stdin.nextInt();
			int[] vals = new int[n];
			for (int i=0; i<n; i++)
				vals[i] = stdin.nextInt();
				
			// How many tiles I am choosing.
			int k = stdin.nextInt();
			
			// Target.
			int t = stdin.nextInt();
			
			// dp[i][j] stores # of subsets with j values adding to i.
			int[][] dp = new int[t+1][k+1];
			dp[0][0] = 1;
			
			// Consider adding the ith value to previous values.
			for (int i=0; i<n; i++) {
			
				// j = # of values with new subset including item i.
				for (int j=k; j>=1; j--) {
				
					// This is the subset sum we are building.
					for (int myw=vals[i]; myw<=t; myw++)
					
						// If there are 5 subsets of size myw-vals[i]
						// with j-1 items, then we can add vals[i] to
						// each of those subsets to create new subsets
						// with j items with sum myw.
						dp[myw][j] += dp[myw-vals[i]][j-1];
				}
			}
			
			// Combo code from class earlier today.
			int[][] combo = new int[n+1][n+1];
			for (int i=0; i<=n; i++)
				combo[i][0] = combo[i][i] = 1;
			for (int i=2; i<=n; i++)
				for (int j=1; j<n; j++)
					combo[i][j] = combo[i-1][j-1]+combo[i-1][j];
		
			// Ta da!
			System.out.println("Game "+loop+" -- "+dp[t][k]+" : "+(combo[n][k]-dp[t][k]));
		}	
	}
}