There are M chocolate packets each packet can have variable number of chocolates in each packet. There are N students (N < M). Distribute chocolate packets to student such that
a) Each student should get 1 packet
b) The difference between the number of chocolates in packet with maximum chocolates and packet with minimum chocolates given to the students should be minimum.
M = 1, 3, 4, 6, 5 (5 packets with specified number of chocolates in them)
N = 3
Output = 3, 5.