#P6076. [JSOI2015] 染色问题

[JSOI2015] 染色问题

Description

Mengmeng has a chessboard. It is an n×mn \times m rectangle, divided into nn rows and mm columns, for a total of n×mn \times m small cells.
Now Mengmeng and Nannan have CC different colors of paint. They want to color the chessboard using these paints and satisfy the following rules:

  1. Each cell on the board can either be colored (painted in one of the CC colors) or left uncolored.
  2. Each row of the board has at least one colored cell.
  3. Each column of the board has at least one colored cell.
  4. Each color appears on the board at least once.

Below are some examples of coloring a 3×33 \times 3 board with C=3C=3 colors (red, yellow, blue) (the figure has been updated):

Compute the total number of different valid coloring schemes that satisfy the requirements. If there exists at least one position whose color is different, then the two coloring schemes are considered different.

Input Format

The input contains only one line with 33 integers n,m,cn, m, c.

Output Format

Output one integer, the total number of different coloring schemes.
Since the total number may be very large, output the value modulo 1,000,000,0071,000,000,007.

2 2 3
60

Hint

For 100%100\% of the testdata, 1n,m,c4001 \le n, m, c \le 400.

Translated by ChatGPT 5