CF40B.Repaintings

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

A chessboard n×mn×m in size is given. During the zero minute we repaint all the black squares to the 0 color. During the ii -th minute we repaint to the ii color the initially black squares that have exactly four corner-adjacent squares painted i1i-1 (all such squares are repainted simultaneously). This process continues ad infinitum. You have to figure out how many squares we repainted exactly xx 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 nn and mm ( 1<=n,m<=50001<=n,m<=5000 ). The second line contains integer xx ( 1<=x<=1091<=x<=10^{9} ).

输出格式

Print how many squares will be painted exactly xx times.

输入输出样例

  • 输入#1

    3 3
    1
    

    输出#1

    4
    
  • 输入#2

    3 3
    2
    

    输出#2

    1
    
  • 输入#3

    1 1
    1
    

    输出#3

    1
    
首页