#include #include #include #include #include #include #include #define MAXN 10010 #define LL long long using namespace std; bool vis[MAXN][MAXN]; struct DOT { int x, y; DOT() {} DOT(int _x, int _y) { x = _x; y = _y; } }dot[MAXN]; struct Matrix { DOT up, down; Matrix() { } Matrix(DOT a, DOT b) { up = a; down = b; } }maxrix[MAXN]; int area(Matrix m) { return (m.down.x-m.up.x)*(m.up.y-m.down.y); } vector vec; bool cmp(DOT a, DOT b) { if(a.x < b.x) return true; if(a.x > b.x) return false; return a.y <= b.y; } int son_judge(DOT t, Matrix m) { int x1 = m.up.x; int y1 = m.up.y; int x2 = m.down.x; int y2 = m.down.y; if(t.x>=x1 && t.x<=x2 && t.y<=y1 && t.y>=y2) { if(t.x>x1 && t.xy2) return 1; return 0; } return -1; } int judge(int i, int j) { DOT t1 = DOT(vec[i].up.x, vec[i].down.y); DOT t2 = DOT(vec[i].down.x, vec[i].up.y); int ok1 = son_judge(vec[i].up, vec[j]); int ok2 = son_judge(vec[i].down, vec[j]); int ok3 = son_judge(t1, vec[j]); int ok4 = son_judge(t2, vec[j]); if(ok1==1&&ok2==1&&ok3==1&&ok4==1) return 1; if(ok1==-1&&ok2==-1&&ok3==-1&&ok4==-1) return -1; return 0; } int main() { int n; while(scanf("%d", &n) && n) { if(n < 8) { puts("imp"); continue; } vec.clear(); memset(vis, 0, sizeof(vis)); for(int i=0; i=y1) continue; if(vis[x2][y1] && vis[x1][y2]) { vec.push_back(Matrix(dot[i], dot[j])); } } } int ans = 0; for(int i=0; i