logo AlgoBeat OnlineJudge
登录 注册

#217721. [ICPC 2026 Wuhan I] Rook

内存限制:512 MiB 时间限制:6000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

There is an chessboard.

You need to place distinct rooks on this chessboard. The placement must satisfy all of the following conditions:

  1. Each cell contains at most one rook.
  2. Every row of the chessboard contains at least one rook.
  3. Every column of the chessboard contains at least one rook.

Please find the total number of valid placements. Since the answer may be very large, you only need to output the result modulo .

输入格式

The input contains only one line.

This line contains three integers in order (), representing the number of rows and columns of the chessboard, and the number of rooks to place, respectively.

输出格式

Output one line containing an integer, the number of valid placements modulo .

样例

样例输入 1

2 2 3

样例输出 1

24

样例输入 2

5 3 4

样例输出 2

0

样例输入 3

353 442 899

样例输出 3

623104742