#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef long double LD; typedef vector VI; typedef pair PII; const LD eps=1e-9; const LD PI=atan2((LD)0,(LD)-1); const LL MOD=1000000007; const int INF=1<<30; const int ARR_INF=1<<6; const int MAXN=1005; const int MAXM=55; const int MULTI=256; int n,m; int ip[MAXN][4]; int ym[MAXM][4]; map mp; void Solve() { for(int i=0;i