AT_abc484_e [ABC484E] Subsegment Sum Finder
Description
You are given a sequence $ A=(A_1,A_2,\dots,A_N) $ of length $ N $ . Find the number of (non-empty) contiguous subsequences whose sum is between $ L $ and $ R $ , inclusive.
Here, even if two contiguous subsequences are equal as sequences, they are counted separately if they are taken from different positions.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ L $ $ R $ $ A_1 $ $ A_2 $ $ \dots $ $ A_N $
Output Format
Print the answer.
Explanation/Hint
### Sample Explanation 1
For this input, there are $ 8 $ pairs $ (l,r) $ such that the contiguous subsequence from the $ l $ -th through $ r $ -th elements satisfies the condition:
- $ (1,1),(1,2),(1,3),(1,5),(2,2),(2,5),(3,5),(4,4) $
### Sample Explanation 2
It is possible that $ L=R $ .
### Constraints
- All input values are integers.
- $ 1 \le N \le 3 \times 10^5 $
- $ -10^{18} \le L \le R \le 10^{18} $
- $ -10^{12} \le A_i \le 10^{12} $