// OB会夏合宿2011 Day4 G : 人魚の魔女 #include #include #include #include using namespace std; typedef complex P; struct L { P p, q; L(P p, P q) : p(p), q(q) {} }; const double EPS = 1e-8; const double PI = acos(-1); double dot(P a, P b) { return real(conj(a)*b); } double cross(P a, P b) { return imag(conj(a)*b); } double angle(P a, P b) { return arg(conj(a)*b); } // 点pの直線l上への写像を求める P footPerp(L l, P p) { return l.p + (l.q-l.p)*(dot(l.q-l.p, p-l.p) / (abs(l.q-l.p)*abs(l.q-l.p))); } // 直線lと点pの距離を求める double distLP(L l, P p){ return abs(cross(l.q-l.p,p-l.p))/abs(l.q-l.p); } // 点pが線分l上に存在するかを判定する bool spIntersect(L l, P p){ return abs(abs(l.p-p)+abs(l.q-p)-abs(l.p-l.q)) < EPS; } int main(){ int N, A, B; P p[30], q[4]; const string res[4] = {"Red", "Green", "Blue", "White"}; while(cin >> N >> A >> B){ for(int i=0;i> p[i].real() >> p[i].imag(); // x=Aで接地してる点をq[3]とし、反時計周りにindex付けする q[3] = P(A, (p[1]-p[0]).imag()/(p[1]-p[0]).real()*(A-p[0].real())+p[0].imag()); q[0] = q[3] + (p[1]-p[0])/abs(p[1]-p[0]); q[2] = q[3] + (q[0]-q[3])*P(0,1); q[1] = q[2] + (q[3]-q[2])*P(0,1); int cur = 0; // 回転中心になる点 int last = 0; // q[cur]が接地している線分の番号 while(q[cur].real() < B){ int next = (cur+1)%4; double rot = -0.5*PI; // 次にどの程度回転するか. 必ず-90°以内になる。 for(int i=last;i+1 EPS) continue; if(tmp > rot){ last = i; next = (cur+j)%4; rot = tmp; } } } } } } // 求めた回転角分だけ、各点をq[cur]を中心に回転する for(int i=1;i<=3;i++) q[(cur+i)%4] = q[cur] + (q[(cur+i)%4]-q[cur])*P(cos(rot), sin(rot)); cur = next; } cout << res[cur] << endl; } }