#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define popcount __builtin_popcount using namespace std; typedef long long int ll; typedef pair P; ll c[25]; int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1}; bool used[1<<25]; void dfs(int b){ used[b]=1; for(int i=0; i<25; i++){ if((b&(1<=5 || y1<0 || y1>=5) continue; if(b&(1<>c[i*5+j]; for(int i=0; i<25; i++) dfs(1<