SP16607 IE1 - Sweets
Description
John has got _n_ jars with candies. Each of the jars contains a different kind of candies (i.e. candies from the same jar are of the same kind, and candies from different jars are of different kinds). The _i_-th jar contains _m $ _{i} $_ candies. John has decided to eat some of his candies. He would like to eat at least _a_ of them but no more than _b_. The problem is that John can't decide how many candies and of what kinds he would like to eat. In how many ways can he do it?
Input Format
The first line of input contains three integers: _n_, _a_ and _b_, separated by single spaces (1 n , 0 a b . Each of the following _n_ lines contains one integer. Line _i+1_ contains integer _m $ _{i} $_ - the amount of candies in the _i_-th jar (0 m $ _{i} $ ).
Output Format
Let _k_ be the number of different ways John can choose the candies to be eaten. The first and only line of output should contain one integer: _k_ mod 2004 (i.e. the remainder of _k_ divided by 2004).