1747. Dropping tests

单点时限: 2.0 sec

内存限制: 256 MB

输入格式

The input test file will contain multiple test cases, each containing exactly three lines. The first line contains two integers, 1 ≤ n ≤ 1000 and 0 ≤ k < n. The second line contains n integers indicating ai for all i. The third line contains n positive integers indicating bi for all i. It is guaranteed that 0 ≤ ai ≤ bi ≤ 1, 000, 000, 000. The end-of-file is marked by a test case with n = k = 0 and should not be processed.

输出格式

For each test case, write a single line with the highest cumulative average possible after dropping k of the given test scores. The average should be rounded to the nearest integer.

样例

Input
3 1
5 0 2
5 1 6
4 2
1 2 7 9
5 6 7 9
0 0
Output
83
100
Hint
To avoid ambiguities due to rounding errors, the judge tests have been constructed so that all answers are at least 0.001 away from a decision boundary (i.e., you can assume that the average is never 83.4997).

7 人解决,12 人已尝试。

9 份提交通过,共有 25 份提交。

7.0 EMB 奖励。

创建: 16 年,8 月前.

修改: 6 年,9 月前.

最后提交: 10 月,3 周前.

来源: Stanford Local 2005

题目标签