Problem

20 /23


Pairs with the maximum difference

Problem

The input of the program is a sequence of N positive integers. All pairs of different elements of the sequence are considered (the elements of a pair do not have to be side by side in the sequence, the order of the elements in the pair is unimportant). It is necessary to define a pair with the maximum difference, the elements of which are at a distance multiple of K. If there are several such pairs, output any one.

Input
The first line of the input specifies the number of numbers N and the value K (\(K+1 <= N <= 10000 \)). Each of the following N lines contains one natural number not exceeding 10000.

Imprint data
As a result, the program should display a pair of numbers corresponding to the condition of the problem

 

Examples
# Input Output
1 8 3
1
90
3
81
89
4
71
7
90 7