A8318 | Games with Rectangle
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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.
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.
输入格式
The first and only line contains three integers: $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$ ( $10^{9}+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.
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.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted