#include using namespace std; using ll = long long; using ld = long double; #define all(s) (s).begin(),(s).end() #define vcin(n) for(ll i=0;i>n[i] #define rever(vec) reverse(vec.begin(), vec.end()) #define sor(vec) sort(vec.begin(), vec.end()) #define fi first #define se second const ll mod = 998244353; //const ll mod = 1000000007; const ll inf = 2000000000000000000ll; static const long double pi = 3.141592653589793; template void chmax(T& t,const U& u){if(t void chmin(T& t,const U& u){if(t>u) t=u;} ll modPow(ll a, ll n, ll mod) { ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; } int main() { /* mod は 1e9+7 */ ios::sync_with_stdio(false); std::cin.tie(nullptr); cout<< fixed << setprecision(10); ll n,l,r; cin>>n>>l>>r; vector a(n); vcin(a); ll dp[r+1][n+1]; ll sum[r+1]; for(int i=0;i<=r;i++){ for(int j=0;j<=n;j++){ dp[i][j]=0; } } for(int i=0;i<=r;i++){ sum[i]=0; } dp[0][0]=1; sum[0]=1; for(int i=0;i<=r;i++){ for(int j=1;j<=n;j++){ ll t=dp[i][j]; for(int k=1;j*k<=i&&k<=a[j-1];k++){ t+=sum[i-k*j]-dp[i-k*j][j]; t%=mod; t+=mod; t%=mod; } t%=mod; dp[i][j]=t; sum[i]+=t; sum[i]%=mod; } } ll ans=0; for(int i=l;i<=r;i++){ ans+=sum[i]; ans%=mod; } cout<