#abc187b. B - Gentle Pairs

B - Gentle Pairs

Score : 200 points\colorbox{red}{\color{white}Score : 200 points}

问题陈述

xyxy 平面上,我们有 NN 个点,编号从 11NN。点 ii 位于 (xi,yi)(x_i, y_i),并且这 NN 个点的 xx 坐标是两两不同的。

找出满足以下条件的整数对 (i,j) (i<j)(i, j)\ (i < j) 的数量:

  • 通过点 ii 和点 jj 的直线斜率在 1-111 之间(包括 1-111)。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

On the xyxy-plane, We have NN points numbered 11 to NN. Point ii is at (xi,yi)(x_i, y_i), and the xx-coordinates of the NN points are pairwise different.

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

  • The line passing through Point ii and Point jj has a slope between 1-1 and 11 (inclusive).

Constraints

  • All values in input are integers.
  • 1N1031 \le N \le 10^3
  • xi,yi103|x_i|, |y_i| \le 10^3
  • xixjx_i \neq x_j for iji \neq j.

Input

Input is given from Standard Input in the following format:

NN

x1x_1 y1y_1

\vdots

xNx_N yNy_N

Output

Print the answer.

Sample Input 1

3
0 0
1 2
2 1

Sample Output 1

2

The slopes of the lines passing through (0,0)(0, 0) and (1,2)(1, 2), passing through (0,0)(0, 0) and (2,1)(2, 1), and passing through (1,2)(1, 2) and (2,1)(2, 1) are 22, 12\frac{1}{2}, and 1-1, respectively.

Sample Input 2

1
-691 273

Sample Output 2

0

Sample Input 3

10
-31 -35
8 -36
22 64
5 73
-14 8
18 -58
-41 -85
1 -88
-21 -85
-11 82

Sample Output 3

11