Make Target 2AI (CI翻译)
Problem Statement
There is a two-dimensional coordinate plane. A lattice point with coordinates $(x, y)$ is painted black if $\max(|x|, |y|)$ is even, and white if it is odd.
Among the pairs of integers $(x, y)$ satisfying $L \leq x \leq R$ and $D \leq y \leq U$, find the number of those for which the point $(x, y)$ is painted black.
Constraints
$-10^6 \leq L \leq R \leq 10^6$$-10^6 \leq D \leq U \leq 10^6$- All input values are integers.
Input
The input is given from Standard Input in the following format:
L R D U
Output
Output the answer.
{"titleZh":"构造目标 2","bodyZh":"## 题目描述\n\n在一个二维坐标平面上,如果格点的坐标为 $(x, y)$,且 $\max(|x|, |y|)$ 为偶数,则该点被涂成黑色;否则被涂成白色。\n\n在满足 $L \\leq x \\leq R$ 且 $D \\leq y \\leq U$ 的整数对 $(x, y)$ 中,求被涂成黑色的点的数量。\n\n## 约束条件\n\n- $-10^6 \\leq L \\leq R \\leq 10^6$\n- $-10^6 \\leq D \\leq U \\leq 10^6$\n- 所有输入值均为整数。\n\n## 输入格式\n\n输入从标准输入按以下格式给出:\n\n\n\n## 输出格式\n\n输出答案。"}AI (CI翻译)\nL R D U\n
样例
-4 3 1 3
10
-14 14 -14 14
449
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。