Kevin is dissatisfied with his current grades. So, he hacks into the school's grading system to give himself some extra points! However, he can only give himself at most points across all of his courses before his teachers get suspicious.
His grades are represented as fractions, each with a numerator that is less than or equal to the denominator . When Kevin adds a point to a grade, both the numerator and the denominator increase by one.
In order to maximize the chances of getting into a good university, Kevin wants to make sure that the average of all his grades is as large as possible. Can you help Kevin with this task?
Constraints
Input Specification
On the first line, you are given two space-separated integers, and .
The second line will contain space-separated integers , each describing the numerator of Kevin's grade in the -th course.
The third line will contain space-separated integers , each describing the denominator of Kevin's grade in the -th course.
Output Specification
Output a single number: the maximum average grade Kevin can obtain as a percentage. Your answer will be considered correct if it is within of the actual answer.
Sample Input 1
3 2
1 2 3
2 5 3
Sample Output 1
72.2222222
Explanation for Sample 1
You can add one points to the first course, making it , then add one point to the second course, making it . Then, the average score is , which, as a percent, is . It can be proven that this solution is optimal.
Sample Input 2
5 100
2 5 9 9 3
10 50 22 51 9
Sample Output 2
59.7345122
Comments