2020 年 “联想杯”全国高校程序设计在线邀请赛暨第三届上海理工大学程序设计竞赛

B. Bamboo Leaf Rhapsody
PDF 题面可用

Do you know who will fulfill people’s wishes on Tanabata?

It’s $\alpha$ Lyra and $\alpha$ Aquila.

By the way, Earth is 25 light-years away from $\alpha$ Lyra and 16 light-years away from $\alpha$ Aquila. That is to say, it will take 25 or 16 years for the messages sent from Earth to reach these two constellations. That’s for granted. Do you understand?

——The Boredom of Haruhi Suzumiya, 2004

This is the $16$th year since the publication of the novel. Apart from the short stories, the author has not updated the series for nine years.

Setsuna is a big fan of the novel. She makes a wish that the author would update as soon as possible, and she will send this message to the stars.

The universe can be seen as a three-dimensional rectangular coordinate system in which the earth is the origin(i.e., the coordinate of the earth is $(0,0,0)$).

Suppose there are $n$ stars, and the coordinate of the $i$-th one is $(x_i,y_i,z_i)$. Any one of them can receive her message.

The speed of the message is exactly $1$ unit per year in the universe, and the direction can be arbitrary.

Setsuna wants to know the shortest time for the message to reach at least one of the stars after she sends it.

You can assume that Einstein’s theory of relativity doesn’t work in Setsuna’s world.

输入格式

The first line contains one integer $n(1 \leq n \leq 1000)$, indicating the number of the stars.

The $i$-th of the next $n$ lines contains three integers $x_i,y_i,z_i(-1000 \leq x_i,y_i,z_i \leq 1000)$, indicating the coordinate of the $i$-th star.

输出格式

Output the shortest time in years, the value should be rounded to three decimal places.

样例

Input
3
0 1 1
2 0 0
0 -2 0

Output
1.414


提示

The first star can receive the message in $\sqrt 2$ years.

The second and the third star can receive the message in $2$ years.

So the answer is $\sqrt 2$ years, and it should be rounded to $1.414$ .

NaN