CF1031A.Golden Plate

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

You have a plate and you want to add some gilding to it. The plate is a rectangle that we split into w×hw\times h cells. There should be kk gilded rings, the first one should go along the edge of the plate, the second one — 22 cells away from the edge and so on. Each ring has a width of 11 cell. Formally, the ii -th of these rings should consist of all bordering cells on the inner rectangle of size (w4(i1))×(h4(i1))(w - 4(i - 1))\times(h - 4(i - 1)) .

The picture corresponds to the third example.Your task is to compute the number of cells to be gilded.

输入格式

The only line contains three integers ww , hh and kk ( 3w,h1003 \le w, h \le 100 , 1kmin(n,m)+141 \le k \le \left\lfloor \frac{min(n, m) + 1}{4}\right\rfloor , where x\lfloor x \rfloor denotes the number xx rounded down) — the number of rows, columns and the number of rings, respectively.

输出格式

Print a single positive integer — the number of cells to be gilded.

输入输出样例

  • 输入#1

    3 3 1
    

    输出#1

    8
    
  • 输入#2

    7 9 1
    

    输出#2

    28
    
  • 输入#3

    7 9 2
    

    输出#3

    40
    

说明/提示

The first example is shown on the picture below.

The second example is shown on the picture below.

The third example is shown in the problem description.

首页