Question description
There are classes in the ABC competitive programming school, and class number () targets students with a rating of .
Now, students are about to join this school. The rating of student number () is . Each student will be dissatisfied if they go to a class that does not match their level. The dissatisfaction for each student is defined as follows:
The absolute difference between the target rating and their own rating , that is, .
For , find the minimum dissatisfaction that can be considered for student number . It is allowed to have classes with no students or classes with multiple students.