포럼
문제 ICPC00222

C. Connect Five

설명

In the town of Nattanham, all roads run either north to south, or east to west, and span the entire town. Furthermore, all roads are an equal distance apart. This makes navigating the town extremely easy.

Unfortunately, the roads are quite poor and could do with a fresh layer of asphalt. However, there is not enough money to fix all the roads, so some sections of road need to be given priority.

The mayor has selected five locations in town that he considers to be of great importance: the city hall, the police station, the hospital, the fire department, and of course the mayor's house. Each of these locations is at an intersection.

The mayor wishes that, for each pair of these important locations, it becomes possible to get from one to the other along a shortest path that consists entirely of refurbished road. Within this restriction, the mayor would like to refurbish the smallest amount of road. The intersections do not count toward this amount. Figure depicts an optimal configuration of refurbished roads.

Input The input consists of:
- Five lines, each with two integers \(x\) and \(y\) (\(0 \le x, y \le 1000\)), the grid coordinates of each of the five important locations.

It is guaranteed that the locations are distinct. Input

Output

Output the minimum number of road segments that need to be refurbished.

제약
입력 형식
출력 형식
예제 1
입력
8 1
3 4
6 7
10 4
1 2
출력
22
예제 2
입력
0 0
0 10
20 0
20 10
3 3
출력
70
문제 정보

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

출처 ICPC NWERC 2024

평가 및 의견

C. Connect Five

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

Log in to rate problems.

개별 의견

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

풀이 제출

C. Connect Five

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