#K70752. Minimum Difference in Classroom Student Distribution
Minimum Difference in Classroom Student Distribution
Minimum Difference in Classroom Student Distribution
In this problem, you are given two positive integers: (M) representing the total number of students and (L) representing the total number of classrooms. Your task is to distribute the students among the classrooms such that the difference between the number of students in the most populated classroom and the least populated classroom is minimized.
Note that if (L > M), some classrooms will have no students, and the minimum difference will be (0). Otherwise, if the students are evenly distributed, i.e., (M \mod L = 0), the difference is (0). If there is a remainder in the division, the extra students will be distributed one per classroom, thereby resulting in a minimum difference of (1).
inputFormat
The input consists of a single line with two space-separated integers: (M) and (L). Here, (M) is the total number of students and (L) is the total number of classrooms.
outputFormat
Output a single integer representing the minimum possible absolute difference between the classroom with the most students and the classroom with the fewest students.## sample
8 3
1
</p>