logo AlgoBeat OnlineJudge
登录 注册

#214844. [ICPC 2021 Seoul R] Grid Triangle

内存限制:1024 MiB 时间限制:500 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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

There exist three different positive integers such that for every pair of the three points of the triangle, you can rotate and translate the cuboid of size 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 is a grid triangle with the cuboid of size . More specifically, the two points are the diagonally opposite vertices of the cuboid of size ; the two points are the diagonally opposite vertices of the cuboid of size ; and the two points are the diagonally opposite vertices of the cuboid of size . Further, all three cuboids are parallel with the grid system.

Write a program to output the number of grid triangles within a bounded 3-dimensional grid system. The grid system is bounded by three given positive integers, , in such a way that all points of grid triangles should be within .

输入格式

Your program is to read from standard input. The input is exactly one line containing three integers, ().

输出格式

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 .

样例

样例输入 1

3 3 3

样例输出 1

48

样例输入 2

3 3 2

样例输出 2

16

样例输入 3

3 2 2

样例输出 3

0