// Maximum-TNT #include #include #include #include #include #include #include #include #include #include using namespace std; #define cin fin const int BUFSIZE = 1024; ifstream fin("video.txt"); #define re real() #define im imag() typedef complex cmp_t; vector g_point; int g_n; double Gaiseki(cmp_t &a,cmp_t &b) { return a.re * b.im - a.im * b.re; } int GetType(cmp_t v1,cmp_t v2) { if(v1.re > 0) return 1; if(v1.im < 0) return 2; if(v1.re < 0) return 3; if(v1.im > 0) return 4; abort(); return 0; } bool Solve() { double lx,ly,ux,uy; lx = ly = INT_MIN; ux = uy = INT_MAX; for(int i = 0 ; i < g_n ; i++) { cmp_t v1 = g_point[i+1]-g_point[i]; cmp_t v2 = g_point[i+2]-g_point[i+1]; if(Gaiseki(v1,v2) > 0) { int type = GetType(v1,v2); if(type == 1) { if(lx < g_point[i+1].re) lx = g_point[i+1].re; if(uy > g_point[i+1].im) uy = g_point[i+1].im; } if(type == 2) { if(ux > g_point[i+1].re) ux = g_point[i+1].re; if(uy > g_point[i+1].im) uy = g_point[i+1].im; } if(type == 3) { if(ux > g_point[i+1].re) ux = g_point[i+1].re; if(ly < g_point[i+1].im) ly = g_point[i+1].im; } if(type == 4) { if(lx < g_point[i+1].re) lx = g_point[i+1].re; if(ly < g_point[i+1].im) ly = g_point[i+1].im; } if(lx > ux || ly > uy) return false; } } return true; } int main() { int case_num = 1; while(cin >> g_n, g_n != 0) { g_point.clear(); for(int i = 0 ; i < g_n ; i++) { double x,y; cin >> x >> y; g_point.push_back(cmp_t(x,y)); } g_point.push_back(g_point[0]); g_point.push_back(g_point[1]); cout << "Floor #" << case_num++ << endl; cout << "Surveillance is "; if(Solve()) cout << "possible." << endl; else cout << "impossible." << endl; cout << endl; } return 0; }