本站作为LDUOnlineJudge的测试版本进行演示,官方网站请访问http://icpc.ldu.edu.cn
[Hidden]

1290. F. Dot the i’s and Cross the T’s


Description

Mr. T, known for his hair cut and the phrase “you fool” in the old TV series “The A Team”, has decided to try out for the UCF Programming Team. Considering the many talented students at UCF, Mr. T’s best chance is to become great at geometry. So, he sought help from Euclid, one of the Fathers of Geometry. Considering the teacher and the student, the obvious place to start iswith the letter T! Consider the picture of the letter T to the right. We define four points A,
M, B, and C form a T if three conditions holds:                                            
1) M is the midpoint of AB                                         
2) CM = AB, i.e., CM is the same length as AB
3) The angles AMC and BMC are 90 degrees.

The Problem:
Given a set of points, you are to determine how many groups of four points form a T based on the above definition.

Input

The first input line contains an integer, n (1 ≤ n ≤ 100), indicating the number of test cases to process. Each test case starts with an integer, p (4 ≤ p ≤ 50), indicating the number of points. Each of the following p input lines provides two real numbers (each between -1000 and 1000, inclusive), indicating (respectively) the x and y coordinates for a point. Assume all points are distinct.

Output

For each set of points, print “Set #n: m”, where n indicates the set number starting with 1 and m indicates how many groups of four points form a T. Two groups of four points are considered different if they differ in at least one point.
Leave a blank line after the output for each set.

Samples

Input Copy
2
5
5.0 2.0
3.0 6.0
5.0 6.0
7.0 6.0
5.0 10.0
4
-3.0 6.0
0.0 6.0
3.0 6.0
0.0 12.0
Output
Set #1: 2

Set #2: 1

Hint

Note/Hint: This problem deals with floating-point numbers and one must be careful about checking for equality of two values. Assume two values are equal if they differ by 10-6 or less.

Source

UCF2016
Problem Information

Time Limit: 1000MS (C/C++,Others×2)
Memory Limit: 128MB (C/C++,Others×2)
Special Judge: No
AC/Submit: 1 / 1
Tags:
Contests involved

1032. UCF 2016
My history solutions

You didn't submit any solution!
Submit your solution

Login Register