Vittorio Plays with LEGO Bricks

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

Vittorio is playing with his new LEGO Duplo bricks. All the bricks have the shape of a square cuboid with a 2×22 \times 2 square base and a height of 11. They can be arranged in the 3D space to build structures, provided that the following rules are met:

  1. No two bricks can intersect, but they can touch on their faces.
  2. The corners of every brick must have integer coordinates (so bricks are axis-aligned) and the zz coordinates of all corners must be non-negative.
  3. The square bases of every brick must be parallel to the ground (i.e. the plane z=0z = 0).
  4. The lower base of any brick that is not touching the ground must touch the upper base of some other brick in a region of positive area (when this happens, the two bricks stay attached to each other thanks to small studs).

For example, this is a valid structure:

Vittorio wants to build a structure that includes purple bricks in the following nn positions: (x_1,0,h),(x_2,0,h),,(x_n,0,h)(x\_1, 0, h), (x\_2, 0, h), \dots , (x\_n, 0, h) — these are the coordinates of the centers of their lower bases; note that all of these bricks have yy coordinate equal to 00 and zz coordinate equal to hh. Vittorio will use additional bricks of other colors to support the purple bricks. He is willing to place bricks only in positions where the center of the lower base has yy coordinate equal to 00. What is the minimum number of additional bricks needed?

It can be shown that a valid construction always exists.

입력

The first line contains two integers nn and hh (1n3001 ≤ n ≤ 300, 0h1090 ≤ h ≤ 10^9) — the number of purple bricks and their common zz coordinate.

The second line contains nn integers x_1,x_2,,x_nx\_1, x\_2, \dots , x\_n (1x_i1091 ≤ x\_i ≤ 10^9, x_i+1<x_i+1x\_i+1 < x\_{i+1}) — the xx coordinates of the purple bricks (centers of the bases), given in increasing order.

출력

Print the minimum number of additional bricks needed.