Count the contiguous subarrays whose sum equals k. Values may be negative.
Input: line 1 — space-separated integers; line 2 — k. Output: the number of such subarrays.
Your program reads from stdin and prints to stdout.
Example 1
Input: 1 1 1 2
Output: 2
Hints