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

Ural Championship 2016

About     Problems     Submit solution     Judge status     Standings
Contest is over

I. Find Denis

Time limit: 2.0 second
Memory limit: 256 MB
Team Ural SU Wine (Eugene, Denis and Vanya) after finishing their ACM career spent some time working on the same project and even in the same office. Two years later Eugene got a job at a prestigious company and moved to St. Petersburg. After some time Denis disappeared from the office as well, but his new place of work remained a mystery for a long time. Fortunately, Denis was forced to contact the organizers through electronic means in order to participate in the preparation of the Ural Championship. When asked where he is now, Denis replied enigmatically: «I work at a distance of X from job of Vanya and, alas, at a distance of Z from my favorite Philharmonic. By the way, it is amusing that the job of Eugene is located on the segment between my workplace and the Philharmonic». Denis’s love to the Philharmonic is well-known, but no one knows where it’s located. However, we know the distance Y from it to Vanya’s workplace (Denis once blurted, before his disappearance). We know as well, of course, the coordinates of Eugene’s and Vanya’s workplaces. Using this information help us find all possible coordinates of Denis’s workplace.


The first line contains integers X, Y and Z ( 1 ≤ X, Y, Z ≤ 10,000, |XY| <Z < X + Y) separated by space. The second line contains integers x1, y1 (−10000 ≤ x1, y1 ≤ 10000 ) separated by space — the coordinates of Vanya’s workplace. The third line contains integers x2, y2 (−10000 ≤ x2, y2 ≤ 10000 ) separated by space — the coordinates of Eugene’s workplace. The coordinates of workplace of Eugene and Vanya don’t match.


In the first line output a nonnegative integer n — the number of all possible coordinates of Denis’s workplace. Then in each of the following n lines output two space-separated real numbers with absolute or relative error of no more than 10− 6x and y coordinates of one of possible locations of Denis’s workplace.
The order of the coordinates is arbitrary.


3 3 3
0 0
2 2
2.354856947624813 1.858668543937608
1.858668543937608 2.354856947624813
2.968700210890174 -0.432225702452595
-0.432225702452595 2.968700210890174
1 1 1
0 0
100 500
28 46 20
28 10
5 -6
5.007867947355766 -5.980045796985991
5.021444895600554 -5.999562660087873


Note that the coordinates of Eugene’s workplace may match the coordinates of Denis’s workplace or coordinates of Philharmonic.
Problem Author: Dmitry Ivankov
To submit the solution for this problem go to the Problem set: 2086. Find Denis