Address: http://www.codeforces.com/problemset/problem/216/A
Method 1:
In YY format, convert it into horizontally aligned graphs...
# Include <iostream> # include <cstring> # include <cstdio> # include <queue> # include <cmath> # include <algorithm> using namespace STD; const int INF = 0x7fffffff; int main () {int A [3], KK, K, sum; while (~ Scanf ("% d", & A [0], & A [1], & A [2]) {sort (A, A + 3 ); k = A [1]-1 + a [0]; sum = 2 * (K * (k + 1)/2) -(A [0] * (a [0]-1)/2); if (a [1] = A [2]) sum-= K; else sum + = (a [2]-A [1]-1) * k; printf ("% d \ n", sum);} return 0 ;} /* 2 3 3 142 2 4132 2 27 */
Method 2:
Place all the small hexagonal
Convert Three-dimensional data into small cubes ~~
It is easy to find that this figure is very similar to a cube ·~
As a result, the question becomes:
A * B * C is composed of some cubes.
From this perspective, how many cubes can you see?
So obviously...
Res = a * B * C-(A-1) * (b-1) * (c-1)
# Include <iostream> # include <cstring> # include <cstdio> # include <queue> # include <cmath> # include <algorithm> using namespace STD; const int INF = 0x7fffffff; int main () {long a, B, c; CIN> A> B> C; cout <a * B * C-(A-1) * (b-1) * (c-1) <Endl; return 0;}/* 2 3 3 142 2 4132 2 27 */