401461: GYM100460 G Eternal Champion

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Eternal Championtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Desmond and Thorwald had almost reached Enia through the net of underground tunnels, guided by the ancient elven runes, when suddenly Desmond sensed a presence of an extraordinary magical power. For the first time he disregarded this fact: sources of extraordinary magical power are ordinary in Enia. But a little time later he sensed it again, when he and Thorwald were on a different place. When Desmond sensed it for the third time, he understood that the source of this extraordinary magical power is the Scepter of the First Kings of Enia, which can become a key to victory over evil Deimos.

All the tunnels are at the same depth under the earth surface. Desmond remembers that the first time he has sensed a presence of the Scepter when he and Thorwald were at the point with the coordinates , the second time — when they were at the point with the coordinates , and the third time — at the point with the coordinates . It is also known to him that the Scepter has such a magic power that its presence can only be felt in the distance at most r from it. Now Desmond wants to know at least an approximate location of the Scepter.

Input

The first line contains a single integer r (1 ≤ r ≤ 103) — the maximal distance where the presence of Scepter can be felt.

Each of the next three lines contains two integers separated by the space: xi and yi ( - 103 ≤ xi, yi,  ≤  + 103) — the coordinates of the points where Desmond has felt the presence of the Scepter. All these points are pairwise distinct.

Output

If the Scepter cannot be located closer than at distance from the given points, you can output «NO» (without quotes) in a single line. If the Scepter can be located closer than at distance from the given points, you can output «YES» (without quotes). In this case in the second line output two real numbers separated by the space — the coordinates of the point satisfying this condition. Please note that in some cases both answers are correct, but if you output «YES» in the first line, you must give a sample of a correct point in the second line.

ExamplesInput
7
0 0
2 3
3 4
Output
YES
7.0 0.0
Input
2
0 0
2 3
3 4
Output
NO

加入题单

算法标签: