logo AlgoBeat OnlineJudge
登录 注册

#210370. [ICPC 2024 Xi'an I] Triangle

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

题目描述

There are three points , , in the plane rectangular coordinate system. Define the size of triangle as the number of squares that belong to it.

For integers , one square is defined by four points , , , . We consider a square to belong to a triangle if half or more of it is inside the triangle.

For example, when , the size of triangle will be . The image below shows which squares are counted in the triangle.

输入格式

The first and only line contains two integers and .

输出格式

Print an integer: the size of triangle .

样例

样例输入 1

6 8

样例输出 1

24

样例输入 2

5 5

样例输出 2

15

样例输入 3

1 999999

样例输出 3

500000