京セラプログラミングコンテスト2021(AtCoder Beginner Contest 200)
C
Ringo's Favorite Numbers 2
AtCoder
⌀ 138
原题
← BD →
翻译中…

Problem Statement

翻译中…

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$.
翻译中…

Constraints

翻译中…
  • All values in input are integers.
  • $2 \le N \le 2 \times 10^5$
  • $1 \le A_i \le 10^9$
翻译中…

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.

翻译中…

样例

Input #1
6
123 223 123 523 200 2000
Output #1
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)$.
Input #2
5
1 2 3 4 5
Output #2
0
There may be no pair satisfying the conditions.
Input #3
8
199 100 200 400 300 500 600 200
Output #3
9
题目信息
题号
abc200_c
时间限制
2 s
内存限制
1024 MB

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