Ringo's Favorite Numbers 2

AtCoder
IDabc200_c
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
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
API Response (JSON)
{
  "problem": {
    "name": "Ringo's Favorite Numbers 2",
    "description": {
      "content": "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 ",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc200_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Ringo loves the integer $200$. Solve the problem below for him.  \nGiven a sequence $A$ of $N$ positive integers, find the pair of integers $(i, j)$ satisfying all of the following conditions:\n\n*   $1 ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments