Hungry Fox

Given cracker temperatures and a starting water temperature, order eating and water sips to minimize and maximize the total of absolute differences.

Medium6GreedySortingMathNo attempts yetTime limit2sMemory limit512 MB

Problem

It is dinner time for your pet fox. His meal consists of NN crackers, and the ii-th cracker has a temperature of TiT_i degrees Celsius. He also has a large dish of water whose temperature is WW degrees Celsius.

After taking an initial sip of water, your fox begins his meal. Every time he eats a cracker, its tastiness is the absolute difference between its temperature and the temperature of the last thing he ate or drank. That last thing is either the previous cracker he ate or a sip of water, whichever he consumed most recently. He can drink some water whenever he wants, and he can eat the crackers in any order.

Depending on the order in which your fox eats and drinks, the total tastiness of the crackers he consumes may vary. Find the minimum and the maximum value of this total.

Input

The first line contains two integers NN and WW (1N1000001 \le N \le 100\,000, 0W1090 \le W \le 10^9): the number of crackers and the temperature of the water.

Each of the next NN lines contains one integer TiT_i (0Ti1090 \le T_i \le 10^9), the temperature of the ii-th cracker.

Output

Print one line with two integers separated by a space: the minimum and the maximum total tastiness your fox can experience during his meal, in that order.