#P317. 【例54.2】 学生组队
【例54.2】 学生组队
Description
Ke has become the coach of a school's programming competition team. Now, she needs to pair up all students in the training team. Each student has an ability value, and only two students with the same ability value can form a team.
Of course, students can also improve their ability by solving problems. Each time a student solves a problem, their ability value increases by one.
Ke wants to know the minimum number of problems that need to be solved so that all students can be paired up.
Input Format
The first line contains an integer (), which is guaranteed to be even.
The second line contains integers, representing the ability values of each student ().
Output Format
Output a single integer—the minimum number of problems that need to be solved so that all students can be paired up.
Sample
6
5 10 2 3 14 55