CF630E.A rectangle
普及+/提高
通过率:0%
时间限制:0.50s
内存限制:64MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Developing tools for creation of locations maps for turn-based fights in a new game, Petya faced the following problem.
A field map consists of hexagonal cells. Since locations sizes are going to be big, a game designer wants to have a tool for quick filling of a field part with identical enemy units. This action will look like following: a game designer will select a rectangular area on the map, and each cell whose center belongs to the selected rectangle will be filled with the enemy unit.
More formally, if a game designer selected cells having coordinates (_x_1, _y_1) and (_x_2, _y_2), where _x_1 ≤ _x_2 and _y_1 ≤ _y_2, then all cells having center coordinates (x, y) such that _x_1 ≤ x ≤ _x_2 and _y_1 ≤ y ≤ _y_2 will be filled. Orthogonal coordinates system is set up so that one of cell sides is parallel to OX axis, all hexagon centers have integer coordinates and for each integer x there are cells having center with such x coordinate and for each integer y there are cells having center with such y coordinate. It is guaranteed that difference _x_2 - _x_1 is divisible by 2.
Working on the problem Petya decided that before painting selected units he wants to output number of units that will be painted on the map.
Help him implement counting of these units before painting.

在为一款新游戏开发回合制战斗场景地图生成工具时,佩佳遇到了如下问题。
地图由六边形格子构成。由于场景尺寸较大,游戏设计师希望拥有一种工具,能够快速地将地图的某一部分区域填满相同的敌方单位。该操作的具体过程如下:游戏设计师在地图上选择一个矩形区域,所有其中心点落在该矩形区域内的格子都将被填入敌方单位。
更形式化地,若游戏设计师选定了坐标分别为 (x1,y1) 和 (x2,y2) 的两个格子(满足 x1≤x2 且 y1≤y2),则所有中心坐标 (x,y) 满足 x1≤x≤x2 且 y1≤y≤y2 的格子都将被填入敌方单位。坐标系采用正交坐标系,使得六边形的一条边与 OX 轴平行;所有六边形中心点的坐标均为整数;对每个整数 x,均存在中心横坐标为 x 的格子;对每个整数 y,也均存在中心纵坐标为 y 的格子。题目保证 x2−x1 是偶数。
在实现填充功能前,佩佳决定先输出将被填充的单位数量。
请帮助他实现该计数功能。

输入格式
The only line of input contains four integers _x_1, _y_1, _x_2, _y_2 ( - 109 ≤ _x_1 ≤ _x_2 ≤ 109, - 109 ≤ _y_1 ≤ _y_2 ≤ 109) — the coordinates of the centers of two cells.
输入仅包含一行,包含四个整数 x1, y1, x2, y2(−109≤x1≤x2≤109,−109≤y1≤y2≤109),表示两个格子中心的坐标。
输出格式
Output one integer — the number of cells to be filled.
输出一个整数——需要填充的单元格数量。
输入输出样例
输入#1
1 1 5 5
输出#1
13
输入解题思路,AI测评打分。不知道怎么写?