400781: GYM100247 C Victor's Research

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

C. Victor's Researchtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Unacknowledged scientist Victor conducts a pseudoscientific research of the relation between integers that cross his mind and the integer that comes into his assistant's mind. He wrote the integers a1, ..., an which had crossed his mind. Then it turned up that the integer s had come into his assistant's mind. Victor wants to determine how many consecutive non-empty sets of integers al, al + 1, ..., ar (l ≤ r) have the sum al + al + 1 + ... + ar = s.

Input

The first line contains two integers separated by space: n and s (1 ≤ n ≤ 200000,  - 2·1014 ≤ s ≤ 2·1014) — the number of integers which crossed Victor's mind and the integer that came into his assistant's mind.

The second line contains n integers separated by space: ai ( - 109 ≤ ai ≤ 109) — the integers which crossed Victor's mind.

Output

Output the only integer — the number of consecutive non-empty sets of integers which have the sum s.

ExamplesInput
5 2
-1 1 2 -1 1
Output
5
Input
6 3
3 -2 1 -1 1 2
Output
3

加入题单

上一题 下一题 算法标签: