#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define F1(x,y,z) for(int x=y;xz;x--) #define F4(x,y,z) for(int x=y;x>=z;x--) #define pb push_back #define LL long long #define co complex #define MAX 100005 #define AMAX 1500 #define MOD 1000000007 #define f(c,d) ((1<<(c))*(d)) using namespace std; int t,n,m,ta,tb,tc; vector va[MAX*3],vb[MAX*3]; bool v[MAX*3]; void dfs(int a){ v[a]=1; tc++; F1(b,0,va[a].size())if(vb[a][b]&(1<=0;tb--){ tc=0; memset(v,0,sizeof(v)); dfs(1); if(tc==n)ta+=1<