~/algor $ cat contests/round-6/H
H. Sums divisible by k
Problem H
ICPC rules
1000 ms
128 MB
An array of integers and a positive integer are given. For how many pairs () is the sum below divisible by ?
Input
The first line contains two positive integers: and . The second line contains integers: .
Output
One integer — the number of pairs.
Note
Examples
Input #1
5 3 1 2 3 4 -1
Output #1
7
Input #2
4 5 -1 -4 5 0
Output #2
6