Empty Squares
면접 대비시간 제한0.1초메모리 제한1024 MB
1xN 보드에 길이 K인 타일 하나가 놓여 있을 때, 남은 서로 다른 길이의 타일들로 겹치지 않게 최대한 많은 칸을 덮고 남는 빈칸 수를 구한다.
문제
Martín has a board of squares. He also has tiles of squares, one of each type. He has placed one of the tiles on the board. His friend, Nico, wants to place some of the remaining tiles in such a way that as many squares as possible are covered. How many squares will remain empty if he succeeds?
Tiles placed on the board cannot overlap each other. Besides, each placed tile must be located completely within the board and must cover whole squares.
입력
The input consists of a single line that contains three integers (), () and (), indicating that the board has squares, and a tile of squares is placed leaving empty squares to its left.
출력
Output a single line with an integer indicating the number of squares that will remain empty if Nico covers as many squares as possible with the remaining tiles.