#P11057. 诈骗题

诈骗题

Background

This is a scam problem.

Problem Description

Define f(n,m)f(n,m) as the answer to the following problem.

Consider an n×mn \times m black-and-white grid, which is initially all white. Each operation is as follows:

  • Choose a white cell (x,y)(x,y) and paint the entire row containing it black. This operation is called (x,y,R)(x,y,\text{R}).
  • Choose a white cell (x,y)(x,y) and paint the entire column containing it black. This operation is called (x,y,C)(x,y,\text{C}).

Suppose you can perform at most kk operations. Ask:

  • Among all plans that perform kk operations, how many essentially different operation sets are there? An operation set is a set of size kk representing the kk operations that were performed. (Note that two plans with different orders but the same operation set are only counted once.)

Two operation sets A,BA, B are called essentially different if and only if there exists an operation optopt such that [optA]+[optB]=1[opt \in A] + [opt \in B] = 1.

Now given n,mn, m, please compute the value of f(i,j)f(i,j) for all 1in, 1jm1 \le i \le n,\ 1 \le j \le m.

Since the answer may be large, you only need to output it modulo 998244353998244353.

Input Format

One line containing two positive integers n,mn, m.

Output Format

Output a matrix with nn rows and mm columns. The number in row ii and column jj should be f(i,j)mod998244353f(i,j) \bmod 998244353.

2 2
2 3
3 16

Hint

Sample Explanation

For f(1,2)f(1, 2), we have k=2k = 2. There are the following 33 possible operation sets:

  • {(1,1,R),(1,2,C)}\{(1, 1, \text R), (1, 2, \text C)\}
  • {(1,1,C),(1,2,R)}\{(1, 1, \text C), (1, 2, \text R)\}
  • {(1,1,C),(1,2,C)}\{(1, 1, \text C), (1, 2, \text C)\}

Note that for the last set, there is more than one operation order, but since they correspond to the same operation set, it is only counted once in the answer.

Constraints

The Luogu code length limit is 50 KB\textbf{50\ KB}.

Test Point ID n=n= m=m=
11 22
22 33
33 55
44 1010
55 2020
66 5050
77 100100
88 11 200200
99 22
1010 300300

For all testdata, it is guaranteed that 1n,m3001 \le n,m \le 300

Translated by ChatGPT 5