CF128C.Games with Rectangle
普及+/提高
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
In this task Anna and Maria play the following game. Initially they have a checkered piece of paper with a painted n × m rectangle (only the border, no filling). Anna and Maria move in turns and Anna starts. During each move one should paint inside the last-painted rectangle a new lesser rectangle (along the grid lines). The new rectangle should have no common points with the previous one. Note that when we paint a rectangle, we always paint only the border, the rectangles aren't filled.
Nobody wins the game — Anna and Maria simply play until they have done k moves in total. Count the number of different ways to play this game.
在本题中,安娜(Anna)与玛丽亚(Maria)玩如下游戏:初始时,她们拥有一张带方格的纸,纸上画有一个 n×m 的矩形(仅绘制边界,不填充)。安娜与玛丽亚轮流行动,安娜先手。每次行动时,玩家需在上一次所画矩形的内部,沿网格线绘制一个新的、更小的矩形;该新矩形与上一个矩形不能有任何公共点。注意:每次绘制矩形时,仅绘制其边界,矩形本身并不填充。
本游戏无胜负之分——安娜与玛丽亚仅持续进行,直至总共完成 k 次行动为止。请计算完成此游戏的不同方式总数。
输入格式
The first and only line contains three integers: n, m, k (1 ≤ n, m, k ≤ 1000).
第一行且唯一一行包含三个整数:n、m、k(1≤n,m,k≤1000)。
输出格式
Print the single number — the number of the ways to play the game. As this number can be very big, print the value modulo 1000000007 (109 + 7).
输出单个数字——即游戏的玩法数量。由于该数字可能非常大,请输出其对 1000000007(即 109+7)取模的结果。
输入输出样例
输入#1
3 3 1
输出#1
1
输入#2
4 4 1
输出#2
9
输入#3
6 7 2
输出#3
75
说明/提示
Two ways to play the game are considered different if the final pictures are different. In other words, if one way contains a rectangle that is not contained in the other way.
In the first sample Anna, who performs her first and only move, has only one possible action plan — insert a 1 × 1 square inside the given 3 × 3 square.
In the second sample Anna has as much as 9 variants: 4 ways to paint a 1 × 1 square, 2 ways to insert a 1 × 2 rectangle vertically, 2 more ways to insert it horizontally and one more way is to insert a 2 × 2 square.
如果最终得到的图片不同,则认为这两种游戏方式不同。换言之,若其中一种方式包含某个矩形,而另一种方式不包含该矩形,则二者不同。
在第一个样例中,安娜仅执行一次操作(也是唯一一次操作),她只有一种可能的操作方案:在一个给定的 3×3 正方形内插入一个 1×1 的正方形。
在第二个样例中,安娜共有 9 种方案:4 种方式绘制 1×1 正方形,2 种方式将 1×2 矩形竖直插入,2 种方式将其水平插入,以及 1 种方式插入一个 2×2 正方形。
输入解题思路,AI测评打分。不知道怎么写?