LearnPy Hub
← Arena
EasyRating 1000

Sharing a Chocolate Strip

Squares of a chocolate strip have numbers on them. Count the segments of exactly m neighbouring squares whose numbers add up to d.

Input

n, then n numbers, then d and m.

Output

One integer.

Sample 1

Input
5
1 2 1 3 2
3 2
Output
2

Sample 2

Input
6
1 1 1 1 1 1
3 2
Output
0
solution.py
Output appears here
Sharing a Chocolate Strip · Python Arena problem · LearnPy Hub