404766: GYM101628 C Choose a Cafeteria
Description
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.
InputThe 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.
OutputIn 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.
ExamplesInput0 5 0 0 7Output
YESInput
-4.99899990 0.10000000 4.99899990 0.10000000
0 5 0 0 100Output
NO