Signal

Time limit2sMemory limit128 MB

Summary
Given n points with no three collinear and no four concyclic, average over all triples the number of points inside or on the circle through the triple.
Level

Hard8 of 10

Topics
Geometry, Combinatorics, Sorting, Two pointers
Solved
No attempts yet

Problem

A telecommunications company is building a GSM (mobile phone) network in Beijing. The network should serve nn houses in the city, but because of a limited budget the company can build only a single antenna.

The antenna is placed by choosing 33 of the nn houses and building it at the center of the circle that passes through those three houses. Then every house that lies inside or on the boundary of that circle receives a signal. The company plans to pick the three houses at random, and to estimate how many houses would receive a signal it wants the average, over all possible choices of three houses, of the number of houses that receive a signal.

Your task is: given the positions of the houses, compute the average number of houses that receive a signal. The positions are given as integer coordinates in the plane. No three houses are collinear, and no four houses lie on the boundary of a common circle.

Input

The first line contains a positive integer nn (3≤n≤15003 \le n \le 1500), the number of houses. Each of the next nn lines describes one house: for 1≤i≤n1 \le i \le n, line i+1i+1 contains two integers xix_i and yiy_i, the coordinates of house ii, separated by a space.

All coordinates are integers with −1000000≤xi,yi≤1000000-1000000 \le x_i, y_i \le 1000000. No three houses are collinear, and no four houses lie on the boundary of a common circle.

Output

Output the average number of houses that receive a signal, as an exact fraction in lowest terms: if the average equals pq\frac{p}{q} in lowest terms with q>1q > 1, print it as p/q; if the average is an integer, print just that integer.

Examples3

  1. Example 1

    Input
    4
    0 2
    4 4
    0 0
    2 0
    
    Expected output
    7/2
    
  2. Example 2

    Input
    3
    0 0
    5 0
    0 7
    
    Expected output
    3
    
  3. Example 3

    Input
    4
    0 0
    6 0
    6 5
    0 4
    
    Expected output
    7/2