LearnPy Hub
← Arena
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
solution.py
Output appears here
Sums Divisible by K · Python Arena problem · LearnPy Hub