CF1031A.Golden Plate
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
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×h cells. There should be k gilded rings, the first one should go along the edge of the plate, the second one — 2 cells away from the edge and so on. Each ring has a width of 1 cell. Formally, the i-th of these rings should consist of all bordering cells on the inner rectangle of size (w−4(i−1))×(h−4(i−1)).
The picture corresponds to the third example.
Your task is to compute the number of cells to be gilded.
你有一块平板,想要在其上添加一些镀金装饰。该平板是一个矩形,被划分为 w×h 个单元格。你需要绘制 k 个镀金环:第一个环沿平板边缘绘制,第二个环距离边缘 2 个单元格,依此类推。每个环的宽度为 1 个单元格。形式化地,第 i 个环应由尺寸为 (w−4(i−1))×(h−4(i−1)) 的内矩形的所有边界单元格组成。
该图对应第三个样例。
你的任务是计算需要镀金的单元格总数。
输入格式
The only line contains three integers w, h and k (3≤w,h≤100, 1≤k≤⌊4min(n,m)+1⌋, where ⌊x⌋ denotes the number x rounded down) — the number of rows, columns and the number of rings, respectively.
唯一一行包含三个整数 w、h 和 k(3≤w,h≤100,1≤k≤⌊4min(w,h)+1⌋,其中 ⌊x⌋ 表示对实数 x 向下取整),分别表示行数、列数和环的数量。
输出格式
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.
第一个示例如下图所示。

第二个示例如下图所示。

第三个示例在题目描述中给出。
输入解题思路,AI测评打分。不知道怎么写?