[USACO 2011 Mar S]Bovine Bridge Battle
题号:NC24626
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

Each of Farmer John's N (4 <= N <= 1,000) cows is patiently waiting in the main pasture with cow i at point with integer coordinates (X_i, Y_i) (-1,000,000,000 <= X_i <= 1,000,000,000; -1,000,000,000 <= Y_i <= 1,000,000,000).
The cows wish to form into groups of four in order to play Bridge, their new favorite card game. Each group must satisfy an important constraint: four cows are allowed to team up if and only if there exists some point X somewhere in the plane (and not coincident with any of the four points of the potential group of four) such that rotating any of the group's cows 180 degrees about that point X gives the position of some other cow in the group.
Please help the cows determine the number of sets of four cows that can form a Bridge group.
The supplied locations of the cows given are all distinct, although they are supplied in no particular order. Furthermore, the answer will fit into a signed 32-bit integer.

输入描述:

* Line 1: A single integer: N
* Lines 2..N+1: Line i+1 contains two space-separated integers: X_i and Y_i

输出描述:

* Line 1: A single integer that is the number of sets of 4 cows that form valid groups for bridge.
示例1

输入

复制
8 
-3 0 
-2 0 
-1 1 
0 3 
2 0 
-3 1 
3 0 
-2 2 

输出

复制
3