408226: GYM103059 G Four Horsemen

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Four Horsementime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Magicians J. Daniel Atlas, Merritt McKinney, Henley Reeves, and Jack Wilder each receive a tarot card leading them to a New York City apartment. A year after their initial meeting, they begin to perform as 'The Four Horsemen' in Las Vegas. Atlas and his comrades mesmerize audiences with magic that drains the bank accounts of the corrupt and funnels the money to audience members.

For the group's next trick, they wish to teleport the contents of a vault from its physical location in Paris to the MGM Grand. The Horsemen are big on audience participation and plan to ask a randomly chosen member to draw a rectangle on stage to serve as a teleportation endpoint. Atlas has a low opinion of the mathematical abilities of audience members (given that they cannot figure out how his tricks work), so he decides to aid the process by marking $$$N$$$ points on the stage that can be chosen as corners of the rectangle. Although McKinney could hypnotize the chosen audience member to pick a specific rectangle, he finds it more enjoyable to watch Reeves and Wilder wrangle the logistics of multiple possible rectangles. The latter two wish to know the number of non-zero-area rectangles an audience member can choose before handling other aspects of the show. Can you help Henley and Jack?

Input

The first line of input contains a single integer $$$N$$$ ($$$1 \leq N \leq 1000$$$), representing the number of points drawn on stage. The next $$$N$$$ lines of input each contain two integers $$$x_i$$$ and $$$y_i$$$ ($$$-10^9 \leq x_i, y_i \leq 10^9$$$), representing the location $$$(x_i, y_i)$$$ of the $$$i$$$-th point when considering the stage as a Cartesian plane.

Output

Output a single integer representing the number of possible rectangles an audience member can choose.

ExampleInput
9
0 0
1 0
0 1
-1 0
0 -1
1 1
1 -1
-1 1
-1 -1
Output
10

加入题单

算法标签: