AT_ndpc2026_j 個数と総和
Description
You are given a sequence of positive integers $ A = (A_1, A_2, \dots, A_N) $ of length $ N $ , and positive integers $ S $ and $ T $ .
Find the number of sequences of non-negative integers $ (c_1, c_2, \dots, c_N) $ that satisfy all of the following conditions, modulo $ 998244353 $ :
- $ c_1 + c_2 + \dots + c_N = S $
- $ A_1 c_1 + A_2 c_2 + \dots + A_N c_N = T $
Input Format
The input is given from standard input in the following format:
> $ N $ $ S $ $ T $ $ A_1 $ $ A_2 $ $ \dots $ $ A_N $
Output Format
Print the number of sequences of non-negative integers $ (c_1, c_2, \dots, c_N) $ that satisfy the conditions, modulo $ 998244353 $ .
Explanation/Hint
### Sample Explanation 1
The following $ 5 $ sequences satisfy the conditions:
- $ (0,2,2,0) $
- $ (0,3,0,1) $
- $ (1,0,3,0) $
- $ (1,1,1,1) $
- $ (2,0,0,2) $
### Constraints
- $ 1 \leq N \leq 20 $
- $ 1 \leq S \leq 10^{18} $
- $ 1 \leq T \leq 10^{18} $
- $ 1 \leq A_i \leq 200 $
- $ \displaystyle \sum_{i=1}^N A_i \leq 200 $
- All input values are integers