Lower Algorithmics

아직 제출이 없습니다시간 제한4초메모리 제한512 MB

문제

You are given a set AA of integers from 11 to 10001000 inclusive. Your task is to find the number of positive integers that can be represented as a sum of several elements of AA, with number of summands being from \ell to rr 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: nn, the number of elements in AA (1n10001 \leq n \leq 1000), followed by \ell and rr, the bounds on number of summands (1r20001 \leq \ell \leq r \leq 2000). The second line contains nn space-separated integers a_1,a_2,,a_na\_1, a\_2, \ldots, a\_n (1a_1<a_2<<a_n10001 \leq a\_1 < a\_2 < \ldots < a\_n \leq 1000): the elements of the set AA in increasing order.

출력

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