아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Jabbing Jets

시간 제한1초메모리 제한2048 MB

요약
주어진 동심원 위에 두 점 사이의 거리가 e 이상이 되도록 점을 최대한 많이 배치한다.
난이도

보통10점 중 7점

유형
기하, 그리디, 수학
정답자
아직 제출이 없습니다

문제

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,…,r_nr\_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 ee.

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 nn and ee (1≤n,e≤1041 \leq n, e \leq 10^4),
  • One line with nn integers r_1,…,r_nr\_1, \ldots, r\_n (1≤r_i≤1041 \leq r\_i \leq 10^4), the radii of the circles.

It is guaranteed that the numbers r_ir\_i are given in increasing order, and that r_i+1−r_i≥er\_{i+1} - r\_i \geq e. Furthermore, it is guaranteed that increasing any radius r_ir\_i by at most 10−610^{-6} will not change the final answer.

출력

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

예제3

  1. 예제 1

    입력
    4 1
    2 3 5 7
    
    예상 출력
    104
    
  2. 예제 2

    입력
    2 2
    2 5
    
    예상 출력
    21
    
  3. 예제 3

    입력
    3 20
    14 53 80
    
    예상 출력
    44