404766: GYM101628 C Choose a Cafeteria

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

Description

C. Choose a Cafeteria time limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

Diogo and Lucas are in São José dos Campos to participate in a programming competition. The event is happening this morning, so they must quickly find somewhere where they can eat.

Diogo looked in the map for the closest cafeterias from where they are and found two cafeterias (with distinct locations) which looked nice and asked Lucas to choose between them.

Lucas told him to choose the one closest to the event location and, if they are at the same distance, the one closest to their current location. Diogo, however, said they were tied in Lucas' criteria, and also the distance between the cafeterias and the event location is the same to their distance to the event.

Now Lucas is wondering if this is possible, and, if affirmative, what are the locations.

Input

The input consists of 5 integers, Ax, Ay, Bx, By, D (|Ax|, |Ay|, |Bx|, |By|, D ≤ 104). Where (Ax, Ay) is their current position, (Bx, By) is the event's position and D is the their distance to the cafeterias.

Output

In the first line of the output print “YES” if it's possible and “NO” otherwise. If it's possible, the second line must contain 4 real numbers Px, Py, Qx, Qy, where (Px, Py) and (Qx, Qy) are the cafeteria locations.

The output must be within a maximum error of 10 - 5.

ExamplesInput
0 5 0 0 7
Output
YES
-4.99899990 0.10000000 4.99899990 0.10000000
Input
0 5 0 0 100
Output
NO

加入题单

上一题 下一题 算法标签: