#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int n,m,l,r,a[100010],sum,now,i,T,flag; int main() { scanf("%d",&T); while (T--) { sum=0; flag=0; memset(a,0,sizeof(a)); scanf("%d%d",&n,&m); for (i=1;i<=n;i++) { scanf("%d",&a[i]); sum+=a[i]; } for (i=m;i<=sum;i+=m) { now=a[1]; l=1;r=1; while (now!=i&&l<=n&&r<=n) { if(now>i) { now-=a[l]; l++; } else if (now