Given a list A of n elements, representing the marks. There are m students and you have to distribute the marks from the list A to m students such that:
1) Each student gets marks.
2) The difference between the maximum marks and minimum marks given to the students is minimised.
Input Format:
The first line contains the value n and m respectively separated by a space.
The second line contains the elements of list A separated by a space
Output Format:
Print the minimum difference
Example:
Input:
7 3
7 3 2 4 8 12 56
Output:
2
Explanation:
We need to pick 3 marks for three students (m=3). If we pick 2, 3 and 4, the difference is minimum which is 2.
En esta página del sitio puede ver el video en línea NPTEL |The Joy of computing using Python | WEEK 11| Programming Assignment-1 Marks distribution de Duración hora minuto segunda en buena calidad , que subió el usuario Ultimate Gamer 05 octubre 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 3,662 veces y le gustó 17 a los espectadores. Disfruta viendo!