#include #include #include #include using namespace std; typedef long long LL; const int mod = 1e9 + 7; const int maxn = 1010; LL d[maxn][maxn*2]; int main() { //freopen("test.txt","r",stdin); int T; scanf("%d",&T); for(int z=1;z<=T;++z) { int n,p; scanf("%d %d",&n,&p); memset(d,0,sizeof d); d[0][p] = 1; for(int i=1;i<=n;++i) { int x; scanf("%d",&x); for(int j=-p+1;j