#include <stdio.h>
#include <string.h>
#include <cmath>
#include <iostream>
using namespace std;
struct point{double x, y;};
int main()
{
int n;
point g, d, h[100000];
while(scanf("%d%lf%lf%lf%lf", &n, &g.x, &g.y, &d.x, &d.y)!=EOF)
{
for(int i = 0; i < n; i++)
scanf("%lf%lf", &h[i].x, &h[i].y);
int i, ok = 0;
for(i = 0; i < n; i++)
if((pow(d.x-h[i].x, 2) + pow(d.y-h[i].y, 2)) >= 4.0*(pow(g.x - h[i].x, 2) + pow(g.y - h[i].y, 2)))
{ok=1;break;}
if(ok) printf("The gopher can escape through the hole at (%.3lf,%.3lf).\n", h[i].x, h[i].y);
else cout << "The gopher cannot escape." << endl;
}
return 0;
}
uva 10310 - Dog and Gopher
最新推荐文章于 2018-02-12 07:09:08 发布