navigation switch
Home
Contests
Notification
Clarification
Problems
Ranklist
Status
HackStatus
×
1005 受影响相关提交已重测
被 EI 加 0 了
Accepts: 0
Submissions: 15
Time Limit: 4000/2000 MS (Java/Others)
Memory Limit: 32768/32768 K (Java/Others)
Problem Description
给定 $n,m$ 。求有多少个不同的正整数序列 $a_1,a_2,\cdots,a_n$ ,使得对任意 $1\leq i\leq n$ 有 $1\leq a_i\leq m$ 且不存在 $1 \leq i \lt j \leq n$ 满足 $\max\limits_{k=1}^i a_k=\min\limits_{k=j}^n a_k$ ,对 $998244353$ 取模。
Input
第一行一个正整数 $T(1\leq T\leq 100000)$ ,代表测试组数。 接下来 $T$ 行,每行包含两个正整数 $n,m(1\leq n\leq 300,1\leq m\leq 10^9)$ 。
Output
$T$ 行,每行一个正整数,代表这组数据的答案,对 $998244353$ 取模。
Sample Input
Copy
3 3 2 3 3 4 10
Sample Output
Copy
2 12 7500