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

13978번 - Cameras 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB175927654.286%

문제

Your street has n houses, conveniently numbered from 1 to n. Out of these n houses, k of them have security cameras installed. Mindful of gaps in coverage, the Neighborhood Watch would like to ensure that every set of r consecutive houses has at least two different houses with cameras. What is the minimum number of additional cameras necessary to achieve this?

입력

The first line of input contains three integers, n (2 ≤ n ≤ 100,000), k (0 ≤ k ≤ n), and r (2 ≤ r ≤ n).

The next k lines of input contain the distinct locations of the existing cameras.

출력

Print, on a single line, a single integer indicating the minimum number of cameras that need to be added.

제한

예제 입력 1

15 5 4
2
5
7
10
13

예제 출력 1

3

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2016 Pacific Northwest Region Programming Contest > Division 1 C번

ICPC > Regionals > North America > Pacific Northwest Regional > 2016 Pacific Northwest Region Programming Contest > Division 2 P번

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

출처

대학교 대회

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

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