| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 4 초 | 512 MB | 24 | 10 | 8 | 88.889% |
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$.
2 1 2 1 2
4
3 1 3 1 3 10
18
6 3 5 1 2 3 4 5 6
28