Dãy số

View as PDF

Submit solution


Points: 0.30 (partial)
Time limit: 1.0s
Memory limit: 256M
Input: stdin
Output: stdout

Problem source:
Sưu tầm
Problem types
Allowed languages
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Cho dãy ~A~ gồm ~N~ số nguyên và ~2~ số ~L,R~.

Đếm số cặp chỉ số ~(i,j), i \leq j~ sao cho $$L \leq \sum_{k=i}^{j} A_k \leq R$$

Input

Dòng đầu gồm ~3~ số nguyên dương ~N \leq 10^5,-10^9 \leq L,R \leq 10^9~.

Dòng thứ hai là dãy ~A~ gồm ~N~ số nguyên, ~|A_i| \leq 10^9~.

Output

Một số nguyên duy nhất là số cặp chỉ số thoả mãn.

Sample Input

4 2 4
1 2 3 4

Sample Output

4

Comments

Please read the guidelines before commenting.


There are no comments at the moment.