IE1 - Sweets

题意翻译

题目描述: John有n个糖果管子。每个罐子都装有不同种类的糖果(即,同一个罐子里的糖果是同类的,而不同罐子的糖果是不同类的)。第i个罐子有mi个糖果。 John决定吃一些糖果,他打算至少吃a个,至多吃b个。求有多少种吃法。 输入: 第一行三个整数n,a,b。 接下来n行,每行一个数mi,表示第i个罐子里的糖果数。 输出: 输出有多少种吃法,结果mod 2004。 感谢@gjc1124646822 提供的翻译

题目描述

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?

输入输出格式

输入格式


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} $ ).

输出格式


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).

输入输出样例

输入样例 #1

2 1 3
3
5

输出样例 #1

9