public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		StringBuilder out = new StringBuilder();
		dp = new boolean[10000][100];
		while ((line = in.readLine()) != null && line.length() != 0) {
			int t = Integer.parseInt(line.trim());
			for (int i = 0; i < t; i++) {
				int[] nk = readInts(in.readLine());
				cleanDP(nk[0], k = nk[1]);
				v = readInts(in.readLine(), k);
				dp[0][sum(0, v[0])] = true;
				for (int r = 1; r < v.length; r++) 
					for (int j = 0; j < k; j++) 
						if (dp[r - 1][j]){
							dp[r][sum(j, v[r])] = true;
							dp[r][sum(j, -v[r])] = true;
						}
				out.append((dp[nk[0]-1][0] ? "Divisible" : "Not divisible")+ "\n");
			}
		}
		System.out.print(out);
	}