Logo
(追記) (追記ここまで)

10559번 - Containment 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
20 초 256 MB55161575.000%

문제

A three-dimensional grid of atomic energy cells aboard the starship PacificNorthwestPassage is reporting failures on several of its cells. The ship’s engineer must set up enclosures that will contain all cells reported to be failing in order to avoid a meltdown. It is imperative that the enclosures be finished in the shortest amount of time, even if that requires some healthy cells to be enclosed along with the defective ones. The enclosures are formed by panels which can only be inserted between cells (so each individual panel must be axis-aligned), and each panel separates exactly two cells and requires one minute to set up. For full containment, each enclosure must form a closed polytope. Given the coordinates of each defective cell, report how long it will take to finish containing the problem.

입력

The input will start with a single line containing the number N giving the number of test cases, 1 ≤ N ≤ 100. Each test case will start with a single line giving the number F, 1 ≤ F ≤ 100, the number of failing cells. Following this will be F lines each with three integers xi, yi, zi, all between 0 and 9, inclusive, giving the locations of the failing cells. For each test case, each triple (xi, yi, zi) will be unique.

출력

For each test case, print on a single line the minimum number of minutes required to fully contain the problem.

제한

예제 입력 1

3
1
0 0 0
2
0 0 0
0 0 1
3
0 0 0
0 0 1
0 1 1

예제 출력 1

6
10
14

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2014 Pacific Northwest Region Programming Contest > Division 1 C번

ICPC > Regionals > North America > Southeast USA Regional > 2014 Southeast USA Regional Programming Contest > Division 1 C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /