Logo
(追記) (追記ここまで)

23451번 - City 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 256 MB222100.000%

문제

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 would like to conduct his research on them. He draws an $n\times m$ grid on the board. The grid consists $n+1$ vertical line segments and $m+1$ horizontal line segments. The vertical and horizontal line segments intersect at exactly $(n+1)\times(m+1)$ points, forming $n\times m$ unit squares. We call the $(n+1)\times (m+1)$ intersections grid points. Output the number of line segments(not only vertical or horizontal) $l$ satisfying the following three conditions:

  1. The length is not zero.
  2. Both endpoints of $l$ are grid points.
  3. The midpoint of $l$ 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 1

예제 출력 1

0

예제 입력 2

2 3

예제 출력 2

14

힌트

출처

Contest > Open Cup > 2019/2020 Season > Stage 10: Grand Prix of Xi’An A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /