#include<cstdio>
#include<cstring>
#include<algorithm>
#define N 100
#define MAX 25000
using namespace std;
void read(int &x)
{
char ch=getchar(); x=0;
while (ch<'0'||ch>'9') ch=getchar();
while (ch>='0'&&ch<='9') x=x*10+ch-48,ch=getchar();
}
int a[N+1],n,T;
bool bz[MAX+1];
void qsort(int l,int r)
{
int i=l,j=r,mid=a[l+r>>1];
while (i<=j)
{
while (a[i]<mid) ++i;
while (a[j]>mid) --j;
if (i<=j) swap(a[i++],a[j--]);
}
if (i<r) qsort(i,r);
if (j>l) qsort(l,j);
}
int main()
{
for (read(T);T-->0;)
{
read(n);
for (int i=1;i<=n;i++) read(a[i]);
qsort(1,n);
memset(bz,0,sizeof bz); bz[0]=1;
int ans=0;
for (int i=1;i<=n;i++)
{
if (! bz[a[i]]){
++ans;
for (int j=a[i];j<=a[n];j++)
bz[j]=bz[j]||bz[j-a[i]];
}
}
printf("%d\n",ans);
}
return 0;
}