提示: 欢迎访问OurACM平台。
Problem 2270 Two Triangles

Accept: 54    Submit: 145
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Fat brother and Maze are playing a kind of special (hentai) game with some points in a two-dimensional plane. First Fat Brother would choose three different points and then Maze would choose other three different points. If both of the player’s points form a triangle, they would feel happy. Also, if these two triangles are exactly the same, they would feel even happier. The two triangles are considered the same if one can be changed from another by translation and rotation.

Now given N points in a plane, Fat Brother would like to know how many different sets of points they can choose in order to make them even happier.

Input

The first line of the data is an integer T (1 <= T <= 100), which is the number of the text cases.

Then T cases follow, each case contains an integer N (6 <= N <= 10) indicated the number of the points in the two-dimensional plane. The N lines follow, each line contains two integers x and y (0 <= x, y <= 10) shows this point’s coordinate. All the points have different coordinate in this plane.

Output

For each case, output the case number first, and then output the number of the different sets of points they can choose in order to make them even happier.

Sample Input

3 6 0 0 2 0 2 1 8 8 10 8 10 9 6 0 0 2 0 2 1 8 8 10 8 10 7 6 0 0 1 0 2 0 0 1 1 1 2 1

Sample Output

Case 1: 2 Case 2: 0 Case 3: 6

Hint

In the first case, Fat Brother can choose a set which contains first three points and Maze can choose a set which contains last three points, this makes a suitable answer. Also, Fat Brother and Maze can change the set they choose and still make a solid result.

Source

第七届福建省大学生程序设计竞赛-重现赛(感谢承办方闽江学院)

Submit  Back  Status  Discuss