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

17586번 - Diagonal Cut 다국어

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

문제

Quido and Hugo are making a chocolate cake. The central ingredient of the cake is a large chocolate bar, lying unwrapped on the kitchen table. The bar is an M × N rectangular grid of chocolate blocks. All of the MN blocks are rectangles of identical shape and size. The chocolate bar is of top quality and the friends want to eat part of it, before the rest is used in the cake.

“OK,” says Quido, “let’s divide the whole bar into two triangular chunks by a straight diagonal cut from its upper-left corner to its lower-right corner. We will then eat all of the blocks which have been cut exactly in half, into two equal-area pieces. You will eat one half and I will eat the other half of each such block. All other blocks, that is, the blocks which are either uncut or cut into two parts of different sizes, will go directly into the cake. Of course, we will make sure the cut is perfectly precise.

Let’s see how much chocolate we get to eat!”

입력

The input consists of two space-separated integers M and N given on a single line, (where 1 ≤ M, N ≤ 1018). The numbers M and N denote the number of blocks in one column and in one row, respectively, in the chocolate bar.

출력

Print the number of blocks of the chocolate bar which are cut into exactly two pieces of equal area.

제한

예제 입력 1

6 10

예제 출력 1

2

예제 입력 2

75206452536745713 10322579177493903

예제 출력 2

40318322589

힌트

출처

ICPC > Regionals > North America > North America Qualification Contest > ICPC North America Qualifier 2019 B번

  • 문제를 만든 사람: Marko Berezovsky
(追記) (追記ここまで)

출처

대학교 대회

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

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