/* SWERC 97 Problem D: Video Surveillance Autor: Falk Bartels Date: 19.11.97 */ #include #define PMAX 100 FILE *input; int n; int px[PMAX], py[PMAX]; int readcase() { int l; fscanf( input, " %d", &n ); if (n==0) return 0; for (l=0; l enclosing rectangle */ east=px[0], west=px[0], north=py[0], south=py[0]; for (l=1; lpx[l]) west=px[l]; if (northpy[l]) south=py[l]; } for (l=0; lpy[l]) north=py[l]; /* northern bound */ if (px[l]>px[(l+1)%n] && southpy[(l+1)%n] && east>px[l]) east=px[l]; /* eastern bound */ } printf("Floor #%d\n", kase); printf("Surveillance is %spossible.\n\n", (north>=south && east>=west)?"":"im"); } int main() { int kase = 0; if ((input=fopen("video.in", "r"))==NULL) { printf("No Inputfile\n"); return 1; } while (readcase()) solvecase( ++kase); return 0; }