Untitled
unknown
c_cpp
2 years ago
598 B
6
Indexable
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll dp[10010];
int main()
{
int t;
cin >> t;
while (t--)
{
int n, m, k;
scanf("%d %d %d", &n, &m, &k);
int coin[n + 1];
for (int i = 1; i <= n; i++)
cin >> coin[i];
dp[0] = 1;
for(int i = 1; i <= n; i++) {
for(int j = m; j >= coin[i]; j--)
dp[j] += dp[j - coin[i]];
}
if(dp[m] >= k) cout << "ENOUGH" << endl;
else cout << dp[m] << endl;
}
return 0;
}Editor is loading...
Leave a Comment