포럼
문제 ICPC00218

J. Jogging Tour

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

You may know that in the 17th century, a group of Dutchmen founded a settlement called New Amsterdam on Manhattan Island that later went on to become New York City. Less well-known is the story of another group of Dutchmen that also moved over to America and founded a city called New Delft. Like its bigger counterpart, New Delft has been built on a grid made up of two sets of parallel streets that meet each other at a perpendicular angle.

Some stroopwafel bakeries have already been built in New Delft, but none of the streets have been constructed. Your task is to lay out the grid of streets. For this, you need to decide on an orientation for the grid so that there are two orthogonal directions for the two types of streets. Once the orientation is fixed, you may build arbitrary streets, as long as each of them has one of the two given directions, as shown in Figure . Each street can be traversed in either direction.

The street layout should be created in an optimal way for the annual Stroopwafel Run. This is an event in which a group of runners visits all the bakeries in some order of their choosing, and they may start and end their run at any point in the city. Your task is to come up with a grid layout that makes this shortest path as short as possible.

제약
입력 형식

The input consists of:
- One line with an integer \(n\) (\(2 \le n \le 12\)), the number of stroopwafel bakeries in New Delft.
- \(n\) lines, each with two integers \(x\) and \(y\) (\(0 \le x,y \le 10^6\)), the coordinates of one of the bakeries.

The bakeries are at distinct coordinates, so for any \(1 \le i,j \le n\) with \(i \neq j\), it holds that \((x_i, y_i) \neq (x_j, y_j)\).

출력 형식

Output the length of the shortest possible path that visits all bakeries in some order, assuming an optimal grid layout.

Your answer should have an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
3
0 1
1 2
3 0
출력
4.24264068712
예제 2
입력
4
1 4
6 0
5 3
2 6
출력
11.1566387517
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NWERC 2023

평가 및 의견

J. Jogging Tour

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

J. Jogging Tour

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8