402581: GYM100812 H Sheep in the Garden
Description
There was nothing left in my life except the way forward. I rode a horse to the city where Dragon had to hide. My mind became free of urgent problems and I started to remember the past unintentionally. The past is a puzzle, like a broken mirror. As you piece it together, you cut yourself, your image keeps shifting. Again and again pictures of my previous life, gone forever, were floating before my eyes.
I was a glorious knight in the service of the King. With my wife and two daughters I lived in a country house. We had a garden of a circular shape, with the radius r and with the center at the origin. Inside it, at the points with coordinates and , two tall trees grew. Daughters loved those trees so I couldn't just cut them. The border of the garden was a green hedge. Not long before that day we bought a sheep, intending to start cattle breeding. I decided to tie the sheep to a pillar with an inextensible rope so that it couldn't gnaw the trees or the green hedge. Also I planned to give the sheep as big area as possible. Really poor idea.
I was working under the cover, trying to find a source of Blue Tea. I almost found Dragon and his laboratory when I was disclosed. Ordered by Dragon, his bandits killed my wife and daughters, while corrupted knights fabricated evidences against me, so that they both became my enemies. Turn around, walk away, blow the kingdom. That would have been the smart thing to do. I guess I wasn't that smart. I didn't even manage to find out where to place the damned pillar for a sheep.
InputThe first line contains a single integer r (2 ≤ r ≤ 109) — the radius of the garden.
The second line contains two integers separated by a space: x1 and y1 (x12 + y12 < r2) — the coordinates of the first tree. The third line in the same way contains two integers x2 and y2 (x22 + y22 < r2) — the coordinates of the second tree. It is guaranteed that points and are different.
OutputOutput a single number rs in the first line — the length of the rope for a sheep. In the second line output two numbers separated by a space — the coordinates of the pillar for a sheep. The area that sheep is able to access has to be entirely inside the circle with the center at the origin and the radius . The distance between the pillar and each of the trees has to be at least . The radius of the area available for a sheep can be less than the radius found by the jury's program by at most 10 - 3.
ExamplesInput3Output
1 1
2 1
2.207106781186547Input
-0.560660172 -0.560660172
3Output
2 1
1 2
2.6094757082487297
-0.276142375 -0.276142375