F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Mathematical Olympiad

Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)
Total Submission(s): 380    Accepted Submission(s): 80


Problem Description
This is a problem from IMO 2011.

Let S be a finite set of at least two points in the plane. Assume that no three points of S are collinear. A windmill is a process that starts with a line l going through a single point P¡ÊS. The line rotates clockwise about the pivot P until the first time that the line meets some other point belonging to S. This point, Q, takes over as the new pivot, and the line now rotates clockwise about Q, until it next meets a point of S. This process continues indefinitely. Show that we can choose a point P in S and a line l going through P such that the resulting windmill uses each point of as a pivot infinitely many times.

Well... This is not your task. Your task is to determine the expected number of steps we need to run to come back to the original state if we choose the pivot point and the first point we meet at random with equal probability.
 

Input
First line, number of test cases, T.
Following are T test cases. For each test case, the first line contains one number, n. Each of the following n lines contains two numbers, X-coordinate and Y-coordinate of one point.

T<=10
3<=n<=1000
Absolute value of all coordinates <= 106
No three points are collinear.
 

Output
T lines, each line contains the answer.
The answer may be a fraction. In this case, you should output it in the simplest form.
 

Sample Input
2 3 0 0 0 1 1 0 4 0 0 0 1 1 0 1 1
 

Sample Output
3 20/3
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-25 13:08:14, Gzip enabled