#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <map>
using std::cin;
using std::cout;
using std::endl;
int m, n, k;
bool dp[2][110];
int a[1000400], now, next = 1;
int main() {
scanf("%d", &m);
while (m --) {
now = 0, next = 1;
scanf("%d%d", &n, &k);
for (int i = 1, num; i <= n; ++ i) {
scanf("%d", &num);
a[i] = (num % k + k) % k;
}
dp[now][0] = true;
for (int i = 1; i <= n; ++ i) {
for (int j = 0; j <= k; ++ j) {
if (dp[now][j] == 0) continue;
dp[next][(j + a[i] + k) % k] = dp[now][j];
dp[next][(j - a[i] + k) % k] = dp[now][j];
}
for (int j = 0; j <= k; ++ j) {
dp[now][j] = 0;
}
now ^= 1;
next ^= 1;
}
if (dp[now][0] != 0) cout << "Divisible" << endl;
else cout << "Not divisible" << endl;
for (int j = 0; j <= n; ++ j) {
dp[now][j] = dp[next][j] = 0;
}
}
}