시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 512 MB219787.500%

문제

You are given a set $A$ of integers from $1$ to $1000$ inclusive. Your task is to find the number of positive integers that can be represented as a sum of several elements of $A$, with number of summands being from $\ell$ to $r$ inclusive. Equal summands are allowed. Note that each number is counted only once, even if it has several such representations.

입력

The first line of the input contains three space-separated integers: $n$, the number of elements in $A$ ($1 \leq n \leq 1000$), followed by $\ell$ and $r$, the bounds on number of summands ($1 \leq \ell \leq r \leq 2000$). The second line contains $n$ space-separated integers $a_1, a_2, \ldots, a_n$ ($1 \leq a_1 < a_2 < \ldots < a_n \leq 1000$): the elements of the set $A$ in increasing order.

출력

Output the number of integers that are representable as a sum of elements of $A$, with number of summands being between $\ell$ and $r$. 

예제 입력 1

2 1 2
1 2

예제 출력 1

4

예제 입력 2

3 1 3
1 3 10

예제 출력 2

18

예제 입력 3

6 3 5
1 2 3 4 5 6

예제 출력 3

28