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

32916번 - Another Brick in the Wall 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB153937160.169%

문제

Alice likes building toy walls. She has a lot of 1ドル \times 2$ bricks and a limited supply of 1ドル \times 3$ bricks. Both types of bricks have a height of 1 and can not be rotated.

Alice is going to build a one unit thick wall of length $l$ and height $h$ out of these bricks. A wall is solid if there are no seams directly above another seam.

Good seam placement Bad seam placement Solid 7ドル \times 4$ wall

Help Alice determine the minimum number of 1ドル \times 3$ bricks required to build a solid wall of length $l$ and height $h$.

입력

The only line contains two integers $l$ and $h,ドル denoting the length and the height of the wall (5ドル \le l \le 1000$; 2ドル \le h \le 1000$).

출력

Print the minimum number of 1ドル \times 3$ bricks required to build a solid $l \times h$ wall.

It can be shown that it is always possible to build a solid wall of length $l$ and height $h$.

제한

예제 입력 1

7 4

예제 출력 1

4

힌트

출처

ICPC > Regionals > Northern Eurasia > Northwestern Russia Regional Contest > ICPC 2024-2025 Northwestern Russia Regional Contest A번

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

출처

대학교 대회

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

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