ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

NEERC 2010, Eastern subregional contest

About     Problems     Submit solution     Judge status     Standings
Contest is over

I. Chapaev at the Planet Ocean

Time limit: 0.5 second
Memory limit: 64 MB
Anka had a dream in which she and Petka were in the Flat World near a planet called Ocean. This planet was a water disk centered at the origin. Looking at the planet, each of them saw a silhouette of a man in the water. Was it possible that they saw the same man? Could he be Chapaev, who needed their help?

Input

The first line contains two numbers separated with a space. The first number is the radius of the planet Ocean; it is an integer in the range from 1 to 1000. The second number is the refractive index of the planet Ocean; it is a real number in the range from 1 to 100 with at most two fractional digits. The second line contains Anka's coordinates and the coordinates of the vector along which she looks at the man in the water. The third line contains Petka's coordinates and the coordinates of the vector along which he looks at the man in the water. The numbers in the second and third lines are separated with a space; they are integers with absolute values not exceeding 1000. It is guaranteed that Petka and Anka are at distinct points outside the planet and the points they see are strictly inside the planet. Petka, Anka, and the men they see inside the planet Ocean must be regarded as points.

Output

Output “Yes” if Petka and Anka may see the same man inside the planet and “No” otherwise. It is guaranteed that in the case of the answer “Yes” the man they see is at a distance of at least 10−4 from the boundary of the planet.

Samples

inputoutput
10 2.0
5 10 0 -1
-5 10 0 -1
Yes
10 1.5
5 10 0 -1
-5 10 0 -1
No

Notes

If α is the angle between an incident ray and the normal vector to the surface at the incidence point and β is the angle between the refracted ray and the normal vector to the surface, then the refractive index equals sin α / sin β.
Problem Author: Alexander Mironenko
Problem Source: NEERC 2010, Eastern subregional contest
To submit the solution for this problem go to the Problem set: 1808. Chapaev at the Planet Ocean