#P8649. [蓝桥杯 2017 省 B] k 倍区间
[蓝桥杯 2017 省 B] k 倍区间
Problem Description
Given a sequence of length , . If the sum of a consecutive subsequence is a multiple of , then we call the interval a -multiple interval.
Can you find how many -multiple intervals there are in the sequence?
Input Format
The first line contains two integers and .
The next lines each contain one integer .
Output Format
Output one integer, representing the number of -multiple intervals.
5 2
1
2
3
4
5
6
Hint
Time limit: 2 seconds, 256M. The 8th Lanqiao Cup 2017.
Translated by ChatGPT 5