arr [ 0. . n - 1 ] represents sizes of packets m is number of students . Returns minimum difference between maximum and minimum values of distribution .
int findMinDiff ( int arr [ ] , int n , int m ) {