300197: CF40B. Repaintings
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Repaintings
题意翻译
有一个 $n \times m$ 大小的棋盘。在 $0$ 分钟时,我们会将所有的黑色的方块重新绘制成 $0$ 色。在 $i$ 分钟期间,我们将最初的黑方块重新绘制成 $i$ 颜色,与这些方块正好有四个角相邻的方块被绘制为 $i - 1$ 颜色(所有的方块在同时被重新绘制)。这个过程一直在进行着,你要计算出我们到底画了多少个方块。 必须要假设棋盘左上角的方块总是黑色的。如果两个正方形恰好有一个公共点,则称它们为角相邻。题目描述
A chessboard $ n×m $ in size is given. During the zero minute we repaint all the black squares to the 0 color. During the $ i $ -th minute we repaint to the $ i $ color the initially black squares that have exactly four corner-adjacent squares painted $ i-1 $ (all such squares are repainted simultaneously). This process continues ad infinitum. You have to figure out how many squares we repainted exactly $ x $ times. The upper left square of the board has to be assumed to be always black. Two squares are called corner-adjacent, if they have exactly one common point.输入输出格式
输入格式
The first line contains integers $ n $ and $ m $ ( $ 1<=n,m<=5000 $ ). The second line contains integer $ x $ ( $ 1<=x<=10^{9} $ ).
输出格式
Print how many squares will be painted exactly $ x $ times.
输入输出样例
输入样例 #1
3 3
1
输出样例 #1
4
输入样例 #2
3 3
2
输出样例 #2
1
输入样例 #3
1 1
1
输出样例 #3
1