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$$$.
Input

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$$$).

Output

Print the answer.

ExamplesInput
2 2 2 1 1 1
Output
5
Input
2 2 2 1 2 1
Output
3
Input
4 5 6 2 3 4
Output
3700125
Input
200 100 100 70 60 30
Output
546626227

加入题单

上一题 下一题 算法标签: