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

25989번 - Jabbing Jets 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 2048 MB140343124.031%

문제

You have just gotten a new job at the Bathroom Accessories Production Company. The first task you are given is to jab holes into showerheads. To prove yourself, you have decided you want to create as many holes as possible.

However, you cannot just randomly drill holes everywhere in the showerhead. (At least, not without getting fired.) In order to ensure that the showerheads look aesthetically pleasing, the company has composed some guidelines which you will have to follow. See Figure J.1 for some examples of aesthetically pleasing showerheads.

  • The holes should be arranged in concentric circles of radii $r_1, r_2, \ldots, r_n$: the center of every hole should be on one of these circles.
  • The distance between the centers of any two holes should be at least $e$.

How many holes can you make at most?

Figure J.1: Possible aesthetically pleasing showerheads for the first two samples.

입력

The input consists of:

  • One line with two integers $n$ and $e$ (1ドル \leq n, e \leq 10^4$),
  • One line with $n$ integers $r_1, \ldots, r_n$ (1ドル \leq r_i \leq 10^4$), the radii of the circles.

It is guaranteed that the numbers $r_i$ are given in increasing order, and that $r_{i+1} - r_i \geq e$. Furthermore, it is guaranteed that increasing any radius $r_i$ by at most 10ドル^{-6}$ will not change the final answer.

출력

Output the maximal number of holes that you can make in the showerhead.

제한

예제 입력 1

4 1
2 3 5 7

예제 출력 1

104

예제 입력 2

2 2
2 5

예제 출력 2

21

예제 입력 3

3 20
14 53 80

예제 출력 3

44

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2022 Preliminaries J번

  • 문제를 만든 사람: Abe Wits
(追記) (追記ここまで)

출처

대학교 대회

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

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