Massive
题号:NC25216
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 128 M,其他语言256 M
64bit IO Format: %lld

题目描述

MINIEYE's engineer M is preparing to perform a real vehicle test on the recently developed ADAS product. Now he has found a path and divides it into N segments. Each segment has its own test value. 

He will select several consecutive segments for testing. In order to enhance the credibility, the number of road segments must be greater than or equal to L; but long-time driving is not good for driver, so the number of road segments must be less than or equal to R; in order to ensure the test effect, the sum of the test values of the chosen segments must be greater than or equal to S. 

M wants you to tell him how many kinds of test plans meet the above conditions.

输入描述:

The first line contains four integers, N, L, R, S (0 < N ≤ 106, 0 < L ≤ R ≤ N, -1011 ≤ S ≤ 1011).

The second line contains N integers, the ith integer Ci (-10≤ C≤ 105) indicates the test value of the ith road segment.

输出描述:

Output a single integer, the number of test plans, in a single line.
示例1

输入

复制
5 2 3 4
1 2 -3 4 5

输出

复制
2