You are given an array $$$A$$$ consisting of $$$N$$$ positive integers, and a positive integer $$$X$$$.
Count the number of pairs of integers $$$(i, j)$$$ ($$$1 \le i \lt j \le N$$$) that satisfy the following:
The first line of the input contains two space-separated integers $$$N$$$ and $$$X$$$ ($$$1 \le N \le 10^6$$$, $$$1 \le X \le 10^6$$$) — the length of the array $$$A$$$ and the value of $$$X$$$, respectively.
The second line of the input consists of $$$N$$$ space-separated integers $$$A_1, A_2, \dots, A_N$$$ ($$$1 \le A_i \le 10^6$$$).
Output one line containing a single integer — the number of pairs $$$(i, j)$$$ such that both $$$A_i + A_j$$$ and $$$A_i \cdot A_j$$$ are divisible by $$$X$$$.
3 22 2 3
1
4 22 4 6 3
3
| Name |
|---|


