#6134. [EC Final 2019] City

[EC Final 2019] City

[EC Final 2019] City

题目描述

Hi ICPCer, welcome to Xi'an.

Being a beautiful ancient city, Xi'an is the capital city of Zhou, Qin, Han, and Tang Dynasties. With a long history, the streets in Xi'an have a grid pattern.

Attracted by the streets' structure, Coach Pang\textit{Pang} would like to conduct his research on them. He draws an n×mn\times m grid on the board. The grid consists n+1n+1 vertical line segments and m+1m+1 horizontal line segments. The vertical and horizontal line segments intersect at exactly (n+1)×(m+1)(n+1)\times(m+1) points, forming n×mn\times m unit squares. We call the (n+1)×(m+1)(n+1)\times (m+1) intersections grid point\textit{grid point}s. Output the number of line segments(not only vertical or horizontal) ll satisfying the following three conditions:

  • The length is not zero.
  • Both endpoints of ll are grid points.
  • The midpoint of ll is a grid point.

输入格式

The only line contains two integers $n, m$($1\le n, m\le 1000$).

输出格式

Print the answer in a single line.
1 1
0
2 3
14

提示

(暂无提示) 标签: P13938|数学|2019|枚举|ICPC|EC Final

来源

P13938|[EC Final 2019] City