Pair Sum Divisibility#8548

Pair Sum Divisibility

1 secondo
128 megabyte
Molto facile

You are given an array of integers A = (a_0, a_1, ..., a_{n-1}) and a positive integer . Find the number of pairs such that i < j and the sum a_i + a_j is divisible by .

Input

The first line contains the integers and k~(2 \le n, k \le 100). The second line contains integers — the elements of the array A = (a_0, a_1, ..., a_{n-1}), where 1 \le a_i \le 100.

Output

Print the number of pairs such that i < j and a_i + a_j is divisible by .

Esempi

Esempio 1

Loading
Loading