21715_EnumeratetheTriangles

2022-5-16 18:20| 发布者: Hocassian| 查看: 30| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505785312300-Problem List-采集的数据-后羿采集器.html

Pro.ID

21715

Title

Enumerate the Triangles

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21715

AC

2

Submit

2

Ratio

100.00%

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/32768 K (Java/Others)
  • 描述

    Little E is doing geometry works. After drawing a lot of points on a plane, he want to enumerate all the triangles which the vertexes are three of the points to find out the one with minimum perimeter. Your task is to implement his work.

    输入

    The input contains several test cases. The first line of input contains only one integer denoting the number of test cases.

    The first line of each test cases contains a single integer N, denoting the number of points. (3 ≤ N ≤ 1000)

    Next N lines, each line contains two integer X and Y, denoting the coordinates of a point. (0 ≤ X, Y ≤ 1000)

    输出

    Description

    Little E is doing geometry works. After drawing a lot of points on a plane, he want to enumerate all the triangles which the vertexes are three of the points to find out the one with minimum perimeter. Your task is to implement his work.

    Input

    The input contains several test cases. The first line of input contains only one integer denoting the number of test cases.

    The first line of each test cases contains a single integer N, denoting the number of points. (3 ≤ N ≤ 1000)

    Next N lines, each line contains two integer X and Y, denoting the coordinates of a point. (0 ≤ X, Y ≤ 1000)

    Output

    For each test cases, output the minimum perimeter, if no triangles exist, output "No Solution".

    Sample Input

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

    Sample Output

    Case 1: No Solution
    Case 2: 4.650

    Source

    样例输入

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

    样例输出

    Case 1: No Solution
    Case 2: 4.650

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部