#P13449. [GCJ 2009 Finals] Min Perimeter

    ID: 13259 远端评测题 15000~30000ms 1024MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>2009Special Judge分治Google Code Jam

[GCJ 2009 Finals] Min Perimeter

Description

You will be given a set of points with integer coordinates. You are asked to compute the smallest perimeter of a triangle with distinct vertexes from this set of points.

Input Format

The first line of the input data gives you the number of cases, TT. TT test cases follow. Each test case contains on the first line the integer nn, the number of points in the set. nn lines follow, each line containing two integer numbers xix_i, yiy_i. These are the coordinates of the ii-th point. There may not be more than one point at the same coordinates.

Output Format

For each test case, output:

Case #X: Y

where XX is the number of the test case and YY is the minimum perimeter. Answers with a relative or absolute error of at most 10510^{-5} will be considered correct. Degenerate triangles — triangles with zero area — are ok.

1
10
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Case #1: 5.656854

Hint

Limits

  • 1T151 \leq T \leq 15
  • 0xi,yi1090 \leq x_i, y_i \leq 10^9

Small dataset(5 Pts)

  • Time limit: 60 15 seconds.
  • 3n100003 \leq n \leq 10000

Large dataset(15 Pts)

  • Time limit: 120 30 seconds.
  • 3n10000003 \leq n \leq 1000000