Consider there are k-lists with numbers in an increasing order. Select one number from each list such that the difference between the highest number and lowest number in the output list is minimum:
list 1-1,3,5,9,10
list 2-2,4,6,8
list 3-7,11,12,13
The output should be 5,6,7.
5 is selected from list-l and 6 from list-2 and 7 from list-3
As the difference between highest and lowest number in that list is 2 that is 7-5 consider there are k-lists.