Fiddlesticks is a champion of League of Legends, he has as his ultimate ability “CrowStorm”, it works as follows:
First Fiddlesticks chooses a strategic location and promptly he prepares to resurface in one direction within a certain distance, then it is rooted and channels the ultimate by just 1.5 seconds, after that time it resurfaces immediately at the target site with a flock of crows flying in the around and causing much damage.
Fiddlesticks want your help to find out if in a certain position it is possible to achieve an invader with his ultimate skill.
Note: Consider that Fiddlesticks always uses his ultimate exactly in the direction of ivasor and the invader always tries to flee in the opposite direction to Fiddlesticks, at a constant speed.
The entry consists of several lines, each line contains the following integer values: Xf, Yf, Xi, Yi, Vi, R1 e R2(0 ≤ Xf, Yf, Xi, Yi, Vi, R1 e R2 ≤ 100), representing respectively the coordinates of Fiddlesticks, the initial coordinates of the invader, the speed of the invader, the ultimate of casting radius and flight radius of crows. Consider the unit of measurement as the meter.
In the output you should print for each line the ‘Y’ character if it is possible to achieve the invasor or ‘N’ otherwise, both followed by a line break.
|Input Sample||Output Sample|
|4 6 22 6 0 16 2|
4 6 22 6 1 16 2
double x1, y1, x2, y2, v, r1, r2, X, Y, dstnce, range;
while(scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2) != EOF)
scanf("%lf%lf%lf", &v, &r1, &r2);
X = (x2-x1)*(x2-x1);
Y = (y2-y1)*(y2-y1);
dstnce = sqrt(X+Y);
dstnce += v*1.50;
range = r1+r2;
if(dstnce > range) printf("N\n");