luogu#P5252. [LnOI2019] 东京夏日相会

[LnOI2019] 东京夏日相会

Background

avartar

“I heard there will be a fireworks festival next week.”

“Huh? I don’t really like places with lots of people.”

“Ah, then I’ll just ask someone else. ╭(╯^╰)╮”

“Hmm, it still sounds fun. I might go. (⊙﹏⊙)b”

Problem Description

Of course, what happened above has absolutely nothing to do with Abbi. As a single deer with a long (zhang) neck, Abbi can only stay at home, holding a “telescope” and lonely watching the fireworks festival from afar.

avartar

What? A 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 approximately considered as a plane. The ii-th firework can be approximately considered as a circle with center (xi,yi)(x_i, y_i) and radius rir_i.

The telescope’s field of view can be approximately considered as a circle. Because adjusting the magnification is tiring, Abbi wants the radius of the field of view to be as small as possible while ensuring that all fireworks appear completely inside the field of view. Please find the center coordinates and the radius of the field-of-view circle.

Input Format

The first line contains an integer nn, meaning there are nn fireworks.

Lines 22 to n+1n + 1 each contain three real numbers xix_i, yiy_i, and rir_i, representing the center coordinates and radius of each firework.

Output Format

Output three real numbers XX, YY, and RR on the first line, representing the center coordinates and radius of the telescope’s field of view. The error of the radius compared with the standard answer must not exceed 0.010.01, and the error of the center coordinates compared with the standard answer must not exceed 0.040.04.

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
3
4.0 1.0 1.0
4.0 7.0 1.0
5.0 5.0 3.0
4.63 4.00 4.07

Hint

avartar

Please enable O2 optimization. It is recommended to use fast input or scanf to read the testdata.

Translated by ChatGPT 5