In high-level Punch-Out!! speedrunning, the world record for the fight against the legendary "Mike Tyson" is decided by frame-perfect execution. In specific phases of the run, after landing an initial punch, you have a razor-thin window to land a follow-up strike:
If you land the second punch within the interval $$$[a, b]$$$, Tyson is stunned and the fight timer remains low. However, if your timing is even one frame too early or too late, he triggers a lengthy taunt animation, effectively ending your world record attempt.
You have been practicing this two-punch sequence relentlessly, recording the exact frame timing of your second punch for $$$n$$$ consecutive attempts. To measure your progress, you want to analyze your "consistency streaks." A good run is defined as any contiguous subarray of attempts where your average timing falls perfectly within the taunt skip window.
Calculate the total number of non-empty contiguous subarrays of your practice session that qualify as a good run.
The first line of input contains three space-separated integers $$$n$$$, $$$a$$$, and $$$b$$$ ($$$1 \le n \le 2 \cdot 10^5, 1 \le a \le b \le 2 \cdot 10^5$$$) — the number of attempts, and the minimum and maximum value of the interval of good runs.
The second line contains $$$n$$$ space-separated integers $$$p_1, p_2, \dots, p_n$$$ ($$$1 \le p_i \le 2 \cdot 10^5$$$), where $$$p_i$$$ represents the frame timing of the second punch on your $$$i$$$-th attempt.
Print a single integer, the total number of contiguous subarrays that are good runs.
6 7 93 4 7 8 9 9
12