AtCoder Beginner Contest 187
B
Gentle Pairs
AtCoder
⌀ 0
原题
← AC →
翻译中…

Problem Statement

翻译中…

On the $xy$-plane, We have $N$ points numbered $1$ to $N$. Point $i$ is at $(x_i, y_i)$, and the $x$-coordinates of the $N$ points are pairwise different.

翻译中…

Find the number of pairs of integers $(i, j)\ (i < j)$ that satisfy the following condition:

翻译中…
  • The line passing through Point $i$ and Point $j$ has a slope between $-1$ and $1$ (inclusive).
翻译中…

Constraints

翻译中…
  • All values in input are integers.
  • $1 \le N \le 10^3$
  • $|x_i|, |y_i| \le 10^3$
  • $x_i \neq x_j$ for $i \neq j$.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N
x_1 y_1
\vdots
x_N y_N

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
3
0 0
1 2
2 1
Output #1
2
The slopes of the lines passing through $(0, 0)$ and $(1, 2)$, passing through $(0, 0)$ and $(2, 1)$, and passing through $(1, 2)$ and $(2, 1)$ are $2$, $\frac{1}{2}$, and $-1$, respectively.
Input #2
1
-691 273
Output #2
0
Input #3
10
-31 -35
8 -36
22 64
5 73
-14 8
18 -58
-41 -85
1 -88
-21 -85
-11 82
Output #3
11
题目信息
题号
abc187_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。