#include #include #include typedef struct { int x, y , test; } loc; loc p[20000]; int cmp(const void *pa, const void *pb) { int a, b; a = ((loc *)pa)->x; b = ((loc *)pb)->x; if (a < b) return -1; else if (a > b) return 1; else { a = ((loc *)pa)->y; b = ((loc *)pb)->y; if (a < b) return -1; else if (a > b) return 1; else return 0; } } int main(void) { int N; double cx, cy; int sx, sy; int i; loc pp, *r; while(1) { scanf("%d\n", &N); if (N == 0) break; sx = 0; sy = 0; for (i = 0; i < N; i++) { scanf("%d %d\n", &p[i].x, &p[i].y); sx += p[i].x; sy += p[i].y; p[i].test = 0; } qsort(p,N,sizeof(p[0]),cmp); cx = sx / (double) N; cy = sy / (double) N; for (i = 0; i < N; i++) { double xx, yy; if (p[i].test == 1) continue; xx = p[i].x + 2 * (cx - p[i].x); yy = p[i].y + 2 * (cy - p[i].y); if (floor(xx) != xx || floor(yy) != yy) { printf("This is a dangerous situation!\n"); goto next; } pp.x = (int)xx; pp.y = (int)yy; r = bsearch(&pp,p,N,sizeof(p[0]),cmp); if (r) { r->test = 1; } else { #if 0 printf("i = %d, [%d, %d]\n", i, p[i].x, p[i].y); printf(" [%d, %d]\n", x1, y1); #endif printf("This is a dangerous situation!\n"); goto next; } } printf("V.I.P. should stay at (%.1f,%.1f).\n", cx, cy); next: } return 0; }