Задача Roads

Файл входного файла: roads.in
Файл выходного файла: roads.out
Ограничение по памяти: 64 MB
Ограничение по времени: 2 s

Описание

Finally, the money allocated for the construction of roads in Byteland, but still only for one. Because the government don't want to give the money at all, it decided to build the shortest possible road. The road should connect two cities (we would say that it is impossible to build an existing road but for the moment not a single road in Byteland exists).

Byteland is a three-dimensional Euclidean space, and the city is a point determined by three coordinates. The length of the road between two cities is equal to the euclidean distance between the cities points.
No two cities have the same coordinates.

Формат входных данных

The first line of the input file contains one integer number N (1 < N <= 10 5 ).
Each of the following N lines contains three integers - X i , Y i , Z i - the coordinates of the cities (0 <= X i , Y i , Z i < 10 5 ).

Формат выходных данных

The only line of the output file must contain the answer to the problem with precision 10 -6 .

Примеры:

ввод вывод

2
1 1 1
2 2 2

1.732050807568877

Added: admin
Difficulty: 0.721646090535
Accepted: 3
Submitted: 6
Источник задачи: KBTU OPEN 2010 SPRING
Analyze this Discuss

Обсуждение:

Начать обсуждение:

Powered by django, eJudge.