P28950 [洛谷] [LnOI2019] Tokyo Summer Rendezvous
省选
题目描述

Problem Background

avatar

"I heard there's a fireworks festival next week."

"Eh? I don't really like crowded places."

"Ah, then I'll ask someone else╭(╯^╰)╮"

"Hmm, it seems quite interesting. I might go (⊙﹏⊙)b"

Problem Description

Of course, the above events have nothing to do with Abbi. As a single deer with a long neck, Abbi can only enjoy the fireworks festival from afar, lonely at home with a "telescope."

avatar

What? What sniper rifle? This is a telescope! (Seriously)

To see all the fireworks in the night sky, Abbi needs to adjust the magnification and position of the "telescope." The night sky can be approximated as a plane, where the $i$-th firework can be roughly considered as a circle with a center at $(x_i, y_i)$ and a radius of $r_i$.

Abbi's telescope field of view can be approximated as a circle. Since adjusting the magnification is tiring, Abbi hopes to ensure that all fireworks appear completely within the field of view while making the radius of the field of view as small as possible. Please calculate the center coordinates and radius of the field of view.

Input Format

The first line contains an integer $n$, indicating the number of fireworks.

From the second line to the $n+1$-th line, each line contains three real numbers $x_i$, $y_i$, and $r_i$, representing the center coordinates and radius of each firework.

Output Format

The first line contains three real numbers, $X$, $Y$, and $R$, representing the center coordinates and radius of the telescope's field of view. The error of your radius from the standard answer must not exceed $0.01$, and the error of the center coordinates must not exceed $0.04$.

Sample Input and Output

Sample Input #1

3
1.0 1.0 1.0
1.0 4.0 1.0
5.0 1.0 1.0

Sample Output #1

3.00 2.50 3.50

Sample Input #2

3
4.0 1.0 1.0
4.0 7.0 1.0
5.0 5.0 3.0

Sample Output #2

4.63 4.00 4.07

Notes

avatar

Please enable O2 optimization. It is recommended to use input optimization or scanf for data input.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 1.0 1.0 1.0 1.0 4.0 1.0 5.0 1.0 1.0
样例输出
3.00 2.50 3.50