[ABC450D] 同余最小极差 (Minimize Range)
Problem Statement
You are given a sequence of positive integers and a positive integer .
You can perform the following operation on the sequence any number of times.
- Choose an integer with , and add to .
Find the minimum possible value of .
Input
The input is given from Standard Input in the following format:
$N$ $K$
$A_1$ $A_2$ $\dots$ $A_N$
Output
Output the answer on a single line.
Example
3 10
3 21 9
4
Note
-
Constraints:
-
-
-
-
All input values are integers.
-
Source: ABC450D