Laboratory samples
Assignment
The samples have been collected from each site. There are some laboratories available which will analyze the samples. The number of samples collected on each site is equal to the number of these laboratories. The research manager has collected all the samples and he is going to make a package of samples for each laboratory. Each laboratory will receive one package and each package will contain one sample from each site. The sample material itself is quite valuable to the laboratories and it is desirable to distribute the samples among the laboratories as fairly as possible. The mass differences between particular packages should be minimal. The samples cannot be divided into smaller pieces.
Task
You are given the masses of all samples. Find out how to distribute the samples into particular packages according to the given rules in such way that the difference between the mass of the heaviest and the mass of the lightest package is minimum possible.
Input
First line of input contains two positive integers N and L separated by space. N is the number of sites and L is the number of laboratories. Next, exactly N lines follow, each line represents one site. The line contains L positive integers separated by space, each integer represents mass of one sample from this site. The sites and the masses of the samples are not presented in any particular order. The value of N does not exceed 25, the value of L does not exceed 15. The mass of any sample does not exceed 300000.
Examples
Public data
The public data set is intended for easier debugging and approximate program correctness checking. The public data set is stored also in the upload system and each time a student submits a solution it is run on the public dataset and the program output to stdout and stderr is available to him/her.