Counting Quadruples of Points

4.5

2 votes
Combinatorics, Geometry, Math, Medium, Meet in the middle
Problem

There are  points in the plane, the  of which is labeled  and has coordinates . How many ordered quadruples of pairwise-distinct indices  are there such that 

Input Format :

The first line of input contains a single integer .

The next  lines of input each contain two space-separated integers  and .

Output Format :

Print a single integer: the number of ordered quadruples satisfying the above condition.

Constraints :

 

Note :

 is the euclidean distance between points  and .

 

Time Limit: 4.5
Memory Limit: 1024
Source Limit:
Explanation

The eight quadruples are:

Editor Image

?