Problem E. Ecology tax

Author:I. Ludov   Time limit:1 sec
Input file:input.txt   Memory limit:64 Mb
Output file:output.txt  

Statement

In a big and rich on natural resources country, the government started a campaign to control deforestation. In fact the government is not too interested in how many trees get fallen, but rather how effectively the wood is utilized. So a law was passed which requires every logging company to pay amount of money in proportion to amount of wood that it wastes during operation.

A felling quota on some territory was allotted to a company in this country. Company lorries may only transport logs of exactly L meters long. So when a tree gets sawed into logs, the remainder is wasted.

Trees in this country grow exactly 1 meter per year, so the company may decrease the amount of tax to be paid by simply waiting for some years. Your task is to determine the number of years needed to achieve smallest possible tax. If there is more than one answer, find minimal (earliest) one.

Input file format

Input file contains number of trees N, length of log L, followed by integers i1 i2… iN — heights of each tree.

Output file format

Output file must contain single integer — number of years to wait.

Constraints

1 ≤ N ≤ 30000, 1 ≤ L, ik ≤ 30000

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
3 1 
10 15 11
0
2
3 2
5 3 6
1

0.084s 0.009s 13