#include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; using namespace std; #define sspeed ios_base::sync_with_stdio(0);cin.tie(0) #define maxn 1005 #define mod 10007 #define eps 1e-9 const int inf=0x3f3f3f3f; const ll infll = 0x3f3f3f3f3f3f3f3fLL; inline ll read() { ll x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } struct node { int x,y; }; node a[maxn]; int g[maxn][maxn]; vector G[maxn]; int one,two,three,four; int n,m; void init() { one=two=three=four=0; memset(a,0,sizeof(a)); memset(g,0,sizeof(g)); for(int i=0;i