Another Brick in the Wall
시간 제한2초메모리 제한2048 MB
1×2와 1×3 벽돌로 l×h 벽을 쌓되 이음선이 바로 위아래로 겹치지 않게 할 때 필요한 1×3 벽돌의 최소 개수를 구한다.
문제
Alice likes building toy walls. She has a lot of bricks and a limited supply of 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 and height out of these bricks. A wall is solid if there are no seams directly above another seam.
Help Alice determine the minimum number of bricks required to build a solid wall of length and height .
입력
The only line contains two integers and , denoting the length and the height of the wall (; ).
출력
Print the minimum number of bricks required to build a solid wall.
It can be shown that it is always possible to build a solid wall of length and height .


