Pias and Chokro are good friends. Pias's birthday is coming soon. So, Chokro wants to gift Pias an array on his birthday. Initially, Chokro has an array $A$ of size $n$ which has values $A_{1}, A_{2}, ..., A_{n}$.

Chokro can perform the following operations on this array any number of times (possibly zero):

$A_{i} = A_{i} + 1$.

$A_{i} = A_{i} - 1$.

Chokro knows that Pias's lucky number is $k$, and he likes an array of equal values. So, to make him more excited Chokro wants to convert the array such that $A_{1} = A_{2} = ... = A_{n}$ and $A_{i} \% k = 0$ for all $i$$(1 \leq i \leq n)$.

As Chokro's online classes are starting soon he doesn't have much time. So, he thought that it would be better to write a code to know the minimum number of operations required to convert the array so that Pias likes that.

But Chokro is afraid of programming. So, he wants your help. Can you help Chokro?

Input

First line will contain two integers $n$, $k$ ($1 \leq n, k \leq 10^{6}$) the size of the array and Pias's lucky number respectively.

Next line will contain n space separated integers $A_{1}$, $A_{2}$, ..., $A_{n}$ ($0 \leq A_{i} \leq 10^{6}$).

Output

Output a single integer the minimum number of operations Chokro needs to convert the array.