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

2008. Swifty

Time limit: 0.5 second
Memory limit: 64 MB
A tamer came to the circus manager and said:
“Mr. Manager, I have the most rare show—the circus flea Swifty, it can jump from one hand to the other by my command!”
“Sounds good, please show it to me.”
The tamer takes the flea, puts it on the manager’s hand and commands:
“Swifty, off you go!”
The flea jumps to the other hand.
“Swifty, off you go!”
The flea jumps back.
“Swifty, off you go!”
Suddenly, the flea jumps to the manager’s head. The pale-faced tamer looks for the flea in the manager’s thick hair. The manager says:
“Don’t bother. You will never find Swifty among my own fleas. Besides, he doesn’t jump too far. I think that your flea isn’t a circus flea but a usual one!”
We know that a usual flea can jump at speed of at most v meters per second. The only power that affects the flea is the gravity that gives it acceleration g = 9.8 m/s2, directed downwards. That’s why the horizontal component of the flea’s speed is constant and the vertical one changes over time. In this problem you can regard the flea as a material point. The circus manager Simon Ildarov is quite a shrewd and suspicious person. The camera in his room managed to record the coordinates of his head and hands, all three points are at the same vertical plane xOy. But unfortunately, the flea is so small that we can’t trace its movement on the camera. Also we can't see on which of Simon Ildarov's hands the flea was situated at the beginning (on the left one or on the right one). Let's determine if a usual flea could have made all those jumps.


The first line of the input contains an integer v that is the maximum initial speed of a usual flea, in meters per second. Then three lines follow, each contains integers xi and yi that are the coordinates of Simon Ildarov’s head and left and right hand, correspondingly, in meters. All points are distinct. All integers are non-negative and do not exceed 10 000. The Ox axis is directed to the right, the Oy axis is directed upwards (that is, opposite to g).


If Swifty can be a usual flea, print “Yes”, otherwise print “No”.


0 5
0 0
10 0
10 5
0 0
10 0
0 5
0 0
10 0


In the first example a flea jumps from the left hand to the right one, then from the right one to the left one, then from the left one to the head. In the second example a flea jumps from the right hand to the left one, then from the left one to the right one, then from the right one to the head. In the third example a flea's speed is too small to jump from one hand to another one.
Problem Author: Olga Karpova. (Prepared by Alexey Kungurtsev)
Problem Source: Ural Regional School Programming Contest 2013