UFPE Starters Final Try-Outs 2020 |
---|
Finished |
After the closing ceremony of an ICPC competition, Lucas and his friend decided to go to the hotel pool to have some magical drinks. After a while, Lucas found a magic swim ring and also realized that the swim rings had some interesting properties:
Assuming the pool is an infinite plane and the swim rings are located at points ($$$X_i$$$, $$$Y_i$$$) with radius $$$R_i$$$, Lucas would like to know the smallest possible radius, such that if he places a magic swim ring centered at the point ($$$x$$$, $$$y$$$), all swim rings would be absorbed by the magic ring.
Example:
In this example, the magic swim ring (red) would need a radius of at least 1 to absorb the blue swim ring. After absorption, its new radius would be equal to 4, and then it would be able to absorb the purple swim ring.
The first line of input contains three integers $$$N$$$ ($$$0 < N \le 10^5$$$) and $$$x$$$, $$$y$$$ ($$$-10^9 < x, y \le 10^9$$$), the number of swim rings and the center of the magic swim ring.
The $$$i$$$-th of the next $$$N$$$ lines contains three integers $$$X_i$$$, $$$Y_i$$$ ($$$-10^9 < X_i, Y_i \le 10^9$$$) and $$$R_i$$$($$$1 < R_i \le 10^5$$$), center and radius of the $$$i$$$-th swim ring.
You must print the minimum radius the magic swim ring should have in order to solve Lucas' challenge. Your answer is considered correct if its absolute or relative error does not exceed $$$10^{-6}$$$.
2 1 1 1 7 3 5 1 3
1.0000000000
4 211 -458 335 369 6 -771 -753 30 193 -617 41 -27 -396 78
870.3531099090
Name |
---|