RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00471

Rasvjeta

Unrated 레이팅 미적용
난이도
1s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

1 \(s / 64\) \(MB / 50\) points

It is Advent season. There are \(M\) street lights in a street \(N\) metres long (the meters of the

street are denoted with numbers from 1 to \(N\) ). Each of the lights lights up the meter of the

street it’s located in and \(K\) meters to the left and to the right of that location. In other words, if

the light is located at meter \(X\) , it lights up all metres of the street from \(X - K\) to \(X + K\) ,

inclusively. Of course, it is possible for a meter of the street to be lit up by multiple street

lights. All lights have distinct locations.

The problem is that there is a possibility that the lights don’t light up all \(N\) metres of the

street. It is your task to determine the minimal amount of additional lights needed to be put

up (at position from 1 to \(N\) ) so that the entire street is lit up.

제약
입력 형식

The first line of input contains the number \(N\) (1 ≤ \(N\) ≤ 1000).
The second line of input contains the number \(M\) (1 ≤ \(M\)\(N\) ).
The third line contains the number \(K\) (0 ≤ \(K\)\(N\) ).
Each of the following \(M\) lines contains a number. The numbers are sorted in ascending order

and represent the positions of each of the \(M\) street lights.
The positions will be distinct and from the interval [1, \(N\) ].

출력 형식

You must output the required number from the task.

예제 1
입력
5
2
2
1
5
출력
0
예제 2
입력
26
3
3
3
19
26
출력
2
예제 3
입력
13
2
10
1
2
출력
1
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2017/2018 Contest 4

평가 및 의견

Rasvjeta

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Rasvjeta

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8