#1174. 数对个数

数对个数

提示:该题测试数据补录中,暂不支持评测提交。

No testdata at current.

No submission language available for this problem.

Score : 300300 points

Problem Statement

Ringo loves the integer 200200. Solve the problem below for him. Given a sequence AA of NN positive integers, find the pair of integers (i,j)(i, j) satisfying all of the following conditions:

  • 1≤i<j≤N1 \le i < j \le N;
  • Ai−AjA_i - A_j is a multiple of 200200.

Constraints

  • All values in input are integers.
  • 2≤N≤2×1052 \le N \le 2 \times 10^5
  • 1≤Ai≤1091 \le A_i \le 10^9

Input

Input is given from Standard Input in the following format:

NN

A1A_1 A2A_2 …\dots ANA_N

Output

Print the answer as an integer.

6
123 223 123 523 200 2000
4

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

5
1 2 3 4 5
0

There may be no pair satisfying the conditions.

8
199 100 200 400 300 500 600 200
9