Problems
#856
~/algor $ cat problems/7hy64HQWGURY
Sums divisible by k
Medium
1000 ms
128 MB
45%
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