408063: GYM102978 A Ascending Matrix
Memory Limit:1024 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
A. Ascending Matrixtime limit per test2 secondsmemory limit per test1024 megabytesinputstandard inputoutputstandard output
You are given integers $$$N,M,K,R,C,$$$ and $$$V$$$. Find the number of $$$N$$$ by $$$M$$$ integer matrices $$$a = (a_{i,j})$$$ that satisfy all of the following conditions, modulo $$$998244353$$$.
- $$$1 \leq a_{i,j} \leq K$$$ for all $$$1 \leq i \leq N,\, 1 \leq j \leq M$$$.
- $$$a_{i,j} \leq a_{i,j+1}$$$ for all $$$1 \leq i \leq N,\, 1 \leq j \leq M-1$$$.
- $$$a_{i,j} \leq a_{i+1,j}$$$ for all $$$1 \leq i \leq N-1,\, 1 \leq j \leq M$$$.
- $$$a_{R,C}=V$$$.
The first line contains integers $$$N$$$, $$$M$$$ ($$$1 \leq N,M \leq 200$$$), $$$K$$$ ($$$1 \leq K \leq 100$$$), $$$R$$$ ($$$1 \leq R \leq N$$$), $$$C$$$ ($$$1 \leq C \leq M$$$), and $$$V$$$ ($$$1 \leq V \leq K$$$).
OutputPrint the answer.
ExamplesInput2 2 2 1 1 1Output
5Input
2 2 2 1 2 1Output
3Input
4 5 6 2 3 4Output
3700125Input
200 100 100 70 60 30Output
546626227