AdvancedRating 1600
Sums Divisible by K
Count contiguous subarrays whose sum is divisible by k.
Input
n k, then n integers.
Output
A count.
Sample 1
Input
6 5 4 5 0 -2 -3 1
Output
7
Sample 2
Input
1 9 5
Output
0
Output appears heren k, then n integers.
A count.
6 5 4 5 0 -2 -3 1
7
1 9 5
0
Output appears here