AT_abc449_c [ABC449C] Comfortable Distance
Description
You are given a string $ S $ of length $ N $ consisting of lowercase English letters.
Find the number of pairs of integers $ (i, j) $ satisfying all of the following conditions:
- $ 1 \leq i \leq j \leq N $
- $ S_i = S_j $
- $ L \leq j - i \leq R $
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ L $ $ R $ $ S $
Output Format
Output the answer.
Explanation/Hint
### Sample Explanation 1
The pairs of integers satisfying all the conditions in the problem statement are $ (i, j) = (2, 6), (3, 5) $ , for a total of two pairs.
### Constraints
- $ 2 \leq N \leq 5 \times 10^5 $
- $ 1 \leq L \leq R \leq N - 1 $
- $ N, L, R $ are integers.
- $ S $ is a string of length $ N $ consisting of lowercase English letters.