#include int N,M,K; int p[1001][100]={0}; int F[100][100][1000] = {0}; int fsz[100][100] = {0}; int D[1000] = {0}; void nyrn(int index,int n){ int i,j,k; if (index == K+1)return; if (p[index][n])return; p[index][n] = 1; for (j=0;j