#JSUTFPC2025A. JSUT —— 江苏理工
JSUT —— 江苏理工
Statement
Hello, guys! Welcome to Jiangsu University of Technology.
Attracted by the campus structure, Timothy wishes to conduct research on it. He draws an grid on the blackboard. The grid consists of vertical line segments and horizontal line segments. The vertical line segments intersect the horizontal line segments exactly at points, forming unit squares. We refer to these intersection points as "grid points". Please output the number of line segments (not limited to vertical or horizontal line segments) that satisfy the following three conditions:
- The length is not zero.
- Both endpoints of are grid points.
- The midpoint of is also a grid point.
Input
One line contains two integers and separated by a space ().
Output
Output an integer representing the number of line segments that satisfy the condition.
Samples
2 3
14
1 1
0