QOJ.ac

QOJ

حد الوقت: 5 s حد الذاكرة: 1024 MB مجموع النقاط: 100

#7974. Coloring

الإحصائيات

Given an $N \times M$ grid where each cell is initially white, you need to color $K$ cells black such that the number of black cells in every row and every column is odd. Find the number of ways to do this.

Input

A single line containing three integers $N, M, K$.

Output

Output a single integer representing the number of ways modulo $998244353$.

Constraints

Test Case ID $N, M$ $K$
$1, 2$ $N \times M \le 20$
$3, 4$ $N \times M \le 100$
$5, 6$ $N \times M \le 5000$ $K \le 100$
$7, 8$ $N \times M \le 5000$
$9, 10, 11$ $N \times M \le 10^5$
$12, 13$ $N \times M \le 5 \times 10^5$ $K \in \{N, M\}$
$14, 15$ $N \times M \le 5 \times 10^5$ $K \le 1000$
$16, 17, 18, 19, 20$ $N \times M \le 5 \times 10^5$

For all test cases, it is guaranteed that $N, M$ are positive integers and $0 \le K \le N \times M$. For all test cases with an even ID, $N=M$.

Examples

Input 1

3 3 5

Output 1

9

Input 2

500 1000 1000

Output 2

928165755

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.