Logo
(追記) (追記ここまで)

23570번 - Grid Triangle 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.5 초 (추가 시간 없음) 1024 MB2211148047.619%

문제

A grid triangle in the 3-dimensional grid system is a triangle of three integral points including the origin $(0,0,0)$ that satisfy the following property:

There exist three different positive integers $X,ドル $Y,ドル $Z$ such that for every pair of the three points of the triangle, you can rotate and translate the cuboid of size $X × Y × Z$ in parallel with the grid system so that the pair are diagonally opposite (and so the farthest way) vertices of the cuboid.

For instance, the triangle of the three points $(0,0,0),ドル $(1,2,3),ドル $(-2,3,1)$ is a grid triangle with the cuboid of size 1ドル × 2 × 3$. More specifically, the two points $(1,2,3),ドル $(-2,3,1)$ are the diagonally opposite vertices of the cuboid $\{(x, y, z)| -2 ≤ x ≤ 1, 2 ≤ y ≤ 3, 1 ≤ z ≤ 3\}$ of size 3ドル × 1 × 2$; the two points $(0,0,0),ドル $(1,2,3)$ are the diagonally opposite vertices of the cuboid $\{(x, y, z)|0 ≤ x ≤ 1, 0 ≤ y ≤ 2, 0 ≤ z ≤ 3\}$ of size 1ドル × 2 × 3$; and the two points $(0,0,0),ドル $(-2,3,1)$ are the diagonally opposite vertices of the cuboid $\{(x, y, z)| -2 ≤ x ≤ 0, 0 ≤ y ≤ 3, 0 ≤ z ≤ 1\}$ of size 2ドル × 3 × 1$. Further, all three cuboids are parallel with the grid system.

Write a program to output the number of grid triangles within a bounded 3-dimenional grid system. The grid system is bounded by three given positive integers, $A,ドル $B,ドル $C,ドル in such a way that all points of grid triangles should be within $\{(x, y, z)| -A ≤ x ≤ A, -B ≤ y ≤ B, -C ≤ z ≤ C\}$.

입력

Your program is to read from standard input. The input is exactly one line containing three integers, $A,ドル $B,ドル $C$ (1ドル ≤ A, B, C ≤ 10,000,000$).

출력

Your program is to write to standard output. Print exactly one line. The line should contain the number of grid triangles in the 3-dimensional grid system bounded by $A,ドル $B,ドル $C$.

제한

예제 입력 1

3 3 3

예제 출력 1

48

예제 입력 2

3 3 2

예제 출력 2

16

예제 입력 3

3 2 2

예제 출력 3

0

힌트

출처

ICPC > Regionals > Asia Pacific > Korea > Asia Regional - Seoul 2021 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /