Problem6703--ABC200 —— C - Ringo's Favorite Numbers 2

6703: ABC200 —— C - Ringo's Favorite Numbers 2

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

Ringo loves the integer $200$. Solve the problem below for him.
Given a sequence $A$ of $N$ positive integers, find the pair of integers $(i, j)$ satisfying all of the following conditions:
  • $1 \le i < j \le N$;
  • $A_i - A_j$ is a multiple of $200$.

Input

Input is given from Standard Input in the following format:
$N$
$A_1\ A_2\ \dots\ A_N$

Output

Print the answer as an integer.

Constraints

All values in input are integers.
$2 \le N \le 2 \times 10^5$
$1 \le A_i \le 10^9$

Sample 1 Input

6
123 223 123 523 200 2000

Sample 1 Output

4
For example, for $(i, j) = (1, 3)$, $A_1 - A_3 = 0$ is a multiple of $200$.
We have four pairs satisfying the conditions: $(i,j)=(1,3),(1,4),(3,4),(5,6)$.

Sample 2 Input

5
1 2 3 4 5

Sample 2 Output

0
There may be no pair satisfying the conditions.

Sample 3 Input

8
199 100 200 400 300 500 600 200

Sample 3 Output

9

HINT

相同题目:ABC200

EDITORIAL

Source/Category