402181: GYM100687 G Graduation Projects (A)
Description
In order to improve teamworking skills of PSUT students, Dr. Saqer decided that each student must have a partner in his graduation project.
According to Dr. Saqer, the quality of any team can be predicted by summing the grades of the team members in his Systems Analysis course. Therefore, the maximum quality of a team is 200, if the two students each scored 100 in the Systems Analysis course.
As the head of the CS department, Dr. Saqer wants to form teams in a way that guarantees a good overall quality in the department. He wants to avoid having very strong teams and very weak teams at the same time. The overall quality can be determined by looking at the difference between the quality of each team and the average quality of all of the teams.
Dr. Saqer defines the quality imbalance as the “sum of the absolute difference between the quality of each project and the average quality of all of the projects”. A low imbalance is preferred over a high imbalance.
Given N teams and the grades of the 2N team members in the Systems Analysis course, calculate the imbalance of this teams formation.
InputThe first line of input contains an integer N (1 ≤ N ≤ 50) representing the number of teams.
The second line contains 2N space-separated integers; each representing the grade of one student.
Each two consecutive students form a team.
OutputPrint the imbalance.
ExamplesInput2Output
23 36 28 8
23.000000000Input
3Output
26 48 16 24 9 8
60.666666667