#include #include #include #include using namespace std; #define MAXN 105 #define MAXM 2050 int G[MAXN][MAXN];/// G: map int pec[MAXN];/// pec: Point Edge Counter int ec;/// ec: Edge Counter int vec[MAXN]; int lec;/// lec: Loop Edge Counter int ans;/// ans: Answer Counter int _global_s; /// Global S struct _edge { int target_point; int last_edge_id; }edge[MAXM]; void dfs(int EdgeStartPoint) { if(lec==_global_s) { ++ans; return; } for(int i=pec[EdgeStartPoint];i!=-1;i=edge[i].last_edge_id) { int v=edge[i].target_point; int flag=1; for(int j=1;j<=lec;j++) { if(!G[v][vec[j]]) { flag=0;break; } } if(flag) { lec++; vec[lec]=v; dfs(v); lec--; } } } int main() { int t; scanf("%d",&t); while(t--) { /// init memset(pec,-1,sizeof(pec)); memset(G,0,sizeof(G)); ec=0; /// Input int N,M,S; scanf("%d %d %d",&N,&M,&S); _global_s=S; for(int i=0;i