Pro.ID21715 TitleEnumerate the Triangles Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21715 AC2 Submit2 Ratio100.00% 时间&空间限制描述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 Sample Output Case 1: No Solution Source 样例输入2 样例输出Case 1: No Solution 作者 |