#include <iostream>
#include <cstring>
using namespace std;
int n, m, k, a[111];
unsigned long long f[10001];
int main() {
int nTest;
cin >> nTest;
while (nTest--) {
cin >> n >> m >> k;
for (int i = 0; i < n; i++) cin >> a[i];
memset(f, 0, sizeof(f));
f[0] = 1;
int vMax = 0;
for (int i = 0; i < n; i++) {
for (int j = vMax; j >= 0; j--) {
if (j + a[i] <= m) {
f[j + a[i]] += f[j];
vMax = max(vMax, j + a[i]);
if (f[j + a[i]] > k)
f[j + a[i]] = k;
}
}
}
if (f[m] >= k)
cout << "ENOUGH" << endl;
else
cout << f[m] << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBuLCBtLCBrLCBhWzExMV07CnVuc2lnbmVkIGxvbmcgbG9uZyBmWzEwMDAxXTsKCmludCBtYWluKCkgewogICAgaW50IG5UZXN0OwogICAgY2luID4+IG5UZXN0OwogICAgd2hpbGUgKG5UZXN0LS0pIHsKICAgICAgICBjaW4gPj4gbiA+PiBtID4+IGs7CiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIGNpbiA+PiBhW2ldOwogICAgICAgIG1lbXNldChmLCAwLCBzaXplb2YoZikpOwogICAgICAgIGZbMF0gPSAxOwogICAgICAgIGludCB2TWF4ID0gMDsKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgICAgICBmb3IgKGludCBqID0gdk1heDsgaiA+PSAwOyBqLS0pIHsKICAgICAgICAgICAgICAgIGlmIChqICsgYVtpXSA8PSBtKSB7CiAgICAgICAgICAgICAgICAgICAgZltqICsgYVtpXV0gKz0gZltqXTsKICAgICAgICAgICAgICAgICAgICB2TWF4ID0gbWF4KHZNYXgsIGogKyBhW2ldKTsKICAgICAgICAgICAgICAgICAgICBpZiAoZltqICsgYVtpXV0gPiBrKQogICAgICAgICAgICAgICAgICAgICAgICBmW2ogKyBhW2ldXSA9IGs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgaWYgKGZbbV0gPj0gaykKICAgICAgICAgICAgY291dCA8PCAiRU5PVUdIIiA8PCBlbmRsOwogICAgICAgIGVsc2UKICAgICAgICAgICAgY291dCA8PCBmW21dIDw8IGVuZGw7CiAgICB9CiAgICByZXR1cm4gMDsKfQo=