/** * Dragon Fantasy (Problem C, Practice Contest for Japan Domestic, 2005-06-19) * by Kenji Inoue, 2006-12-30 **/ #include #include using namespace std; #define EPS (1e-10) int n, dx, dy; bool answer; int cx[20], cy[20]; // crystals bool done[20]; double dist(int x, int y) { return sqrt(x*x + y*y); } void solve(double t, int x, int y) { if (answer) { return; } int collected = 0; for (int i=0; i> n >> hx >> hy >> dx >> dy, (n || hx || hy || dx || dy)) { for (int i=0; i> cx[i] >> cy[i]; } memset(done, false, sizeof(done)); answer = false; solve(0.0, hx, hy); if (answer) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }