/* coder: ACboy date: 2010-3-21 result: AC description: UVa 10310 Dog and Gopher */ #include <iostream> #include <cmath> using namespace std; struct Point { long long x; long long y; }; Point points[1100]; int n; Point dogPos; Point gopherPos; long long getDis(Point & a, Point & b) { return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y); } int main() { #ifndef ONLINE_JUDGE freopen("10310.txt", "r", stdin); #endif while (cin >> n) { int i, j; double x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; gopherPos.x = x1 * 1000; gopherPos.y = y1 * 1000; dogPos.x = x2 * 1000; dogPos.y = y2 * 1000; for (i = 0; i < n; ++i) { cin >> x1 >> y1; points[i].x = x1 * 1000; points[i].y = y1 * 1000; } int ok = 0; int pos = -1; for (j = 0; j < n; ++j) { long long dis1 = getDis(dogPos, points[j]); long long dis2 = getDis(gopherPos, points[j]); if (dis2 * 4 <= dis1) { pos = j; ok = 1; break; } } if (ok) { printf("The gopher can escape through the hole at (%.3lf,%.3lf)./n", (double)points[pos].x / 1000, (double)points[pos].y / 1000); } else { cout << "The gopher cannot escape." << endl; } } }