AT_ndpc2026_i 更新点

Description

For a sequence $ B = (B_1, B_2, \dots, B_N) $ of length $ N $ , define **prefix max update positions** and **suffix max update positions** as follows: - An index $ i $ is called a prefix max update position if for all $ 1 \leq j < i $ , we have $ B_j < B_i $ . - An index $ i $ is called a suffix max update position if for all $ i < j \leq N $ , we have $ B_j < B_i $ . You are given a sequence $ A = (A_1, A_2, \dots, A_N) $ of length $ N $ , and integers $ L $ and $ R $ . Consider all sequences obtained by rearranging the elements of $ A $ . Among them, count how many sequences have exactly $ L $ prefix max update positions and exactly $ R $ suffix max update positions. Output the answer modulo $ 998244353 $ . Two sequences are considered the same if they are identical as sequences.

Input Format

The input is given from standard input in the following format: > $ N $ $ L $ $ R $ $ A_1 $ $ A_2 $ $ \dots $ $ A_N $

Output Format

Print the number of sequences satisfying the conditions, modulo $ 998244353 $ .

Explanation/Hint

### Sample Explanation 1 There are $ 2 $ such sequences: - $ (3,2,1,4) $ - $ (3,1,2,4) $ ### Constraints - $ 1 \leq N \leq 400 $ - $ 1 \leq L \leq N $ - $ 1 \leq R \leq N $ - $ 1 \leq A_i \leq N $ - All input values are integers