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

28044번 - Empty Squares 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
0.1 초 1024 MB139565151.000%

문제

Martín has a board of 1ドル \times N$ squares. He also has $N$ tiles of 1ドル \times 1, 1 \times 2, \dots , 1 \times N$ 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 $N$ (1ドル ≤ N ≤ 1000$), $K$ (1ドル ≤ K ≤ N$) and $E$ (0ドル ≤ E ≤ N - K$), indicating that the board has 1ドル \times N$ squares, and a tile of 1ドル \times K$ squares is placed leaving $E$ 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.

제한

예제 입력 1

6 2 2

예제 출력 1

3

예제 입력 2

1000 1 1

예제 출력 2

1

힌트

출처

ICPC > Regionals > Latin America > Latin America Regional Contests > Latin America Regional Contests 2022 E번

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

출처

대학교 대회

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

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