首页 > 试题广场 >

City

[编程题]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 would like to conduct his research on them. He draws an grid on the board. The grid consists vertical line segments and horizontal line segments. The vertical and horizontal line segments intersect at exactly points, forming unit squares. We call the intersections s. Output the number of line segments(not only vertical or horizontal) satisfying the following three conditions:
1.The length is not zero.
2.Both endpoints of are grid points.
3.The midpoint of is a grid point.


输入描述:
The only line contains two integers ().


输出描述:
Print the answer in a single line.
示例1

输入

1 1

输出

0
示例2

输入

2 3

输出

14
头像 hoi33
发表于 2020-01-12 21:37:52
这是今年我的最后一场,顺便写一下游记,第一场因为发挥打铁,心里很郁闷,加之最近学业加(我们学院都是硬件专业) 。那天考了四级(不能过)就和另外一个队一起坐高铁来到西安,到的时候时间还有还可以打一打热身赛,不得不说志愿者服务真好。第一天热身赛,看了一眼,旁边都是比我们好的学校,直接签了A题,C++,J 展开全文