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×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.
输入格式
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.
输出格式
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.