#include #include #include #include #include #include #include using namespace std; typedef long long ll; const int N=1005; const int MOD=1E8+7; int d[N][N],f[N][N],n,T,ans,x,w; void updata(int &u,int w) { u=(u+w)%MOD; } int main() { for (int i=0;i>T; while (T--) { cin>>n; memset(f,0,sizeof(f)); f[0][0]=1; ans=0; for (int i=1;i<=n;i++) { scanf("%d",&x); for (int j=0;j