402181: GYM100687 G Graduation Projects (A)

Memory Limit:64 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Graduation Projects (A)time limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard output

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.

Input

The 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.

Output

Print the imbalance.

ExamplesInput
2
23 36 28 8
Output
23.000000000
Input
3
26 48 16 24 9 8
Output
60.666666667

加入题单

算法标签: