3376 - Counting Rectangles 3376 - Contando Rectángulos 3376 - Counting Rectangles

Statistics Sub: 143 | AC: 27 | AC%: 18,88 | Score: 3,45
Created by Luis Enrique Garcia Marrero
Added by legar (2015-09-28)
Limits
Total Time: 20000 MS | Test Time: 1500 MS |Memory: 256 MB | Output: 64 MB | Size: 16 KB
Enabled languages
Available in

Description

Given N distinct points in the plane by their integer coordinates you must calculate the number of rectangles which can be painted such that their vertices lies on some quartet of the given points. Note that sides of the rectangles could be others than segments parallel to coordinates axis.
Dados N puntos diferentes en el plano por sus coordenadas enteras usted debe calcular la cantidad de rectángulos que pueden ser dibujados de tal forma que sus vértices están sobre algún cuarteto de los puntos dados. Note que los lados de los rectángulos no tienen por qué ser segmentos paralelos a los ejes de coordenadas.
Given N distinct points in the plane by their integer coordinates you must calculate the number of rectangles which can be painted such that their vertices lies on some quartet of the given points. Note that sides of the rectangles could be others than segments parallel to coordinates axis.

Input specification

The first line contains an integer N (4 <= N <= 2000) representing the number of point in the plane. Each of the next N lines describes a different point with two integers X and Y (-10^9 <= X, Y <= 10^9), indicating the coordinates of the point. No two points have the same location.
La primera línea contiene un número entero N (4 <= N <= 2000) que representa la cantidad de puntos en el plano. Cada una de las siguientes N líneas describe un punto diferente mediante dos números enteros X e Y (-10^9 <= X, Y <= 10^9), indicando las coordenadas del punto. No habrá dos puntos en una misma ubicación.
The first line contains an integer N (4 <= N <= 2000) representing the number of point in the plane. Each of the next N lines describes a different point with two integers X and Y (-10^9 <= X, Y <= 10^9), indicating the coordinates of the point. No two points have the same location.

Output specification

Output a line with an integer representing the number of rectangles which can be painted such that their vertices lies on some quartet of the given points.
Usted debe imprimir una línea con un número entero que representa la cantidad de rectángulos que pueden ser dibujados de tal forma que sus vértices están sobre algún cuarteto de los puntos dados.
The first line contains an integer N (4 <= N <= 2000) representing the number of point in the plane. Each of the next N lines describes a different point with two integers X and Y (-10^9 <= X, Y <= 10^9), indicating the coordinates of the point. No two points have the same location.

Sample input

8
0 0
0 1
1 0
1 1
2 0
2 1
3 0
3 1

Sample output

6

Hint(s)

http://coj.uci.cu/24h/
http://coj.uci.cu/24h/
http://coj.uci.cu/24h/

Recommendation

We have carefully selected several similar problems: 2769 | 1873 | 2441 | 2534 | 2141 | 3232