Page not loading? Try clicking here.
Placeholder

#1899

Beetles 4s 256MB

Problems

A beetle finds itself on a thin horizontal branch. “Here I am on a thin horizontal branch,” thinks the beetle, “I feel pretty much like on an x-axis!” It surely is a beetle of deep mathematical thought.

There are also N drops of dew on that same branch, each holding m units of water. Their beetle–based integer coordinates are x_1, x_2, \cdots, x_N.

It is clear that the day will be hot. Already in one unit of time one unit of water goes away from each drop. The beetle is thirsty. It is so thirsty that if it reached a drop of dew it would drink it in zero time. In one unit of time the beetle can crawl one unit of length. But would all this crawling pay off? That’s what buzzes the beetle.

So you are to write a program which, given coordinates of dew drops, calculates the maximal amount of water the beetle can possibly drink.


Input

The input is read from standard input. The first line contains two integers N and m.

The next N lines contain integer coordinates x_1, x_2, \cdots, x_N.

Constraints : 0 \le N \le 300, 1 \le m \le 1\,000\,000, -10\,000 \le x_1, x_2, \cdots, x_N \le 10\,000, All the values of x_i are pairwise different.


Output

The program should write one line to standard output containing a single integer: the maximal amount of water the beetle can possibly drink.


Example

3 15

6
-3
1
25


Source

Baltic Olympiad in Informatics 2009

You must sign in to write code.