Sky Reflector

AtCoder
IDarc113_d
Time2000ms
Memory256MB
Difficulty
In a grid with $N$ horizontal rows and $M$ vertical columns of squares, we will write an integer between $1$ and $K$ (inclusive) on each square and define sequences $A, B$ as follows: * for each $i=1,\dots, N$, $A_i$ is the minimum value written on a square in the $i$\-th row; * for each $j=1,\dots, M$, $B_j$ is the maximum value written on a square in the $j$\-th column. Given $N, M, K$, find the number of different pairs of sequences that can be $(A, B)$, modulo $998244353$. ## Constraints * $1 \leq N,M,K \leq 2\times 10^5$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $M$ $K$ [samples]
Samples
Input #1
2 2 2
Output #1
7

$(A_1,A_2,B_1,B_2)$ can be $(1,1,1,1)$, $(1,1,1,2)$, $(1,1,2,1)$, $(1,1,2,2)$, $(1,2,2,2)$, $(2,1,2,2)$, or $(2,2,2,2)$ - there are seven candidates.
Input #2
1 1 100
Output #2
100
Input #3
31415 92653 58979
Output #3
469486242
API Response (JSON)
{
  "problem": {
    "name": "Sky Reflector",
    "description": {
      "content": "In a grid with $N$ horizontal rows and $M$ vertical columns of squares, we will write an integer between $1$ and $K$ (inclusive) on each square and define sequences $A, B$ as follows: *   for each $i",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc113_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "In a grid with $N$ horizontal rows and $M$ vertical columns of squares, we will write an integer between $1$ and $K$ (inclusive) on each square and define sequences $A, B$ as follows:\n\n*   for each $i...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments