Give you a multiset S. Could you find a subset T of S such that for all x, y belongs to T, (x – y) % m = 0 and |T| = k. |T| means the number of elements in set T.
Input
The first line
will be three integers n, k, m. (2 <= k <= n <= 105, 1
<= m <= 105)
The second line will have n integers. The
absolute value of the integer doesn’t exceed 109.