CF216A.Tiling with Hexagons
普及-
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Several ages ago Berland was a kingdom. The King of Berland adored math. That's why, when he first visited one of his many palaces, he first of all paid attention to the floor in one hall. The floor was tiled with hexagonal tiles.
The hall also turned out hexagonal in its shape. The King walked along the perimeter of the hall and concluded that each of the six sides has a, b, c, a, b and c adjacent tiles, correspondingly.
To better visualize the situation, look at the picture showing a similar hexagon for a = 2, b = 3 and c = 4.

According to the legend, as the King of Berland obtained the values a, b and c, he almost immediately calculated the total number of tiles on the hall floor. Can you do the same?
若干年前,贝尔兰是一个王国。贝尔兰国王酷爱数学。因此,当他首次参观自己众多宫殿之一时,首先注意到的是某座大厅的地面——地面由正六边形瓷砖铺成。
这座大厅本身也呈正六边形。国王沿大厅外围走了一圈,发现六条边分别依次有 a、b、c、a、b 和 c 块相邻的瓷砖。
为更直观地理解这一情形,请参看下图:它展示了一个类似结构的六边形,其中 a=2、b=3、c=4。

据传说,当贝尔兰国王得知 a、b 和 c 的值后,几乎立刻就算出了大厅地板上瓷砖的总数。你也能做到吗?
输入格式
The first line contains three integers: a, b and c (2 ≤ a, b, c ≤ 1000).
第一行包含三个整数:a、b 和 c(2 ≤ a, b, c ≤ 1000)。
输出格式
Print a single number — the total number of tiles on the hall floor.
输出一个数字——大厅地板上的瓷砖总数。
输入输出样例
输入#1
2 3 4
输出#1
18
输入解题思路,AI测评打分。不知道怎么写?