Vittorio Plays with LEGO Bricks
시간 제한2초메모리 제한1024 MB
주어진 x 위치와 높이 h에 놓인 보라색 블록을 떠받치기 위해, 각 블록이 아래 블록과 양의 넓이로 맞닿도록 할 때 필요한 최소 추가 블록 수를 구한다.
문제
Vittorio is playing with his new LEGO Duplo bricks. All the bricks have the shape of a square cuboid with a square base and a height of . They can be arranged in the 3D space to build structures, provided that the following rules are met:
- No two bricks can intersect, but they can touch on their faces.
- The corners of every brick must have integer coordinates (so bricks are axis-aligned) and the coordinates of all corners must be non-negative.
- The square bases of every brick must be parallel to the ground (i.e. the plane ).
- 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 positions: — these are the coordinates of the centers of their lower bases; note that all of these bricks have coordinate equal to and coordinate equal to . 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 coordinate equal to . 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 and (, ) — the number of purple bricks and their common coordinate.
The second line contains integers (, ) — the coordinates of the purple bricks (centers of the bases), given in increasing order.
출력
Print the minimum number of additional bricks needed.