{"problem":{"name":"C. Choose a Cafeteria","description":{"content":"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 th","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":65536},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10162C"},"statements":[{"statement_type":"Markdown","content":"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.\n\nDiogo 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.\n\nLucas 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.\n\nNow Lucas is wondering if this is possible, and, if affirmative, what are the locations.\n\nThe 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.\n\nIn 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.\n\nThe output must be within a maximum error of 10 - 5.\n\n## Input\n\nThe 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.\n\n## Output\n\nIn 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.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ A = (A_x, A_y) \\in \\mathbb{R}^2 $ be Diogo and Lucas's current position.  \nLet $ B = (B_x, B_y) \\in \\mathbb{R}^2 $ be the event location.  \nLet $ D \\in \\mathbb{R}^+ $ be the fixed distance from $ A $ to each cafeteria.  \n\nLet $ P = (P_x, P_y) $ and $ Q = (Q_x, Q_y) $ be the two distinct cafeteria locations.  \n\n**Constraints**  \n1. $ \\|P - A\\| = \\|Q - A\\| = D $  \n2. $ \\|P - B\\| = \\|Q - B\\| $  \n3. $ P \\ne Q $  \n4. $ \\|P - B\\| = \\|A - B\\| $  \n\n**Objective**  \nDetermine if there exist distinct points $ P, Q \\in \\mathbb{R}^2 $ satisfying the above.  \nIf yes, output “YES” and the coordinates $ (P_x, P_y, Q_x, Q_y) $; otherwise output “NO”.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10162C","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}