e-olymp
Problems

Divisible Sum Pairs

Divisible Sum Pairs

You are given an array of integers A = (a0, a1, ..., an-1) and a positive integer k. Find and print the number of pairs (i, j) where i < j and ai + aj is divisible by k.

Input

The first line contains integer n (2n, k100) and k. The second line contains n space-separated integers describing the values of A = (a0, a1, ..., an-1) (1ai100).

Output

Print the number of pairs (i, j) where i < j and ai + aj is divisible by k.

Time limit 1 second
Memory limit 128 MiB
Input example #1
6 3
1 3 2 6 1 2
Output example #1
5