Score : $500$ points
We have a number sequence $A = (A_1, A_2, \dots, A_N)$ of length $N$ and integers $X$ and $Y$. Find the number of pairs of integers $(L, R)$ satisfying all the conditions below.
Input is given from Standard Input in the following format:
$N$ $X$ $Y$ $A_1$ $A_2$ $\dots$ $A_N$
Print the answer.
4 3 1 1 2 3 1
4
$4$ pairs satisfy the conditions: $(L,R)=(1,3),(1,4),(2,4),(3,4)$.
5 2 1 1 3 2 4 1
0
No pair $(L,R)$ satisfies the condition.
5 1 1 1 1 1 1 1
15
It may hold that $X=Y$.
10 8 1 2 7 1 8 2 8 1 8 2 8
36