{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\nIn a certain course, you take \u003ci\u003en\u003c/i\u003e tests. If you get \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e out of \u003ci\u003eb\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e questions correct on test \u003ci\u003ei\u003c/i\u003e, your cumulative average is defined to be\n\u003c/p\u003e\u003ccenter\u003e\n\t100 * Σ\u003csup\u003en\u003c/sup\u003e\u003csub\u003ei\u003d1\u003c/sub\u003ea\u003csub\u003ei\u003c/sub\u003e / Σ\u003csup\u003en\u003c/sup\u003e\u003csub\u003ei\u003d1\u003c/sub\u003eb\u003csub\u003ei\u003c/sub\u003e.\n\u003c/center\u003e\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003e\nGiven your test scores and a positive integer \u003ci\u003ek\u003c/i\u003e, determine how high you can make your cumulative average if you are allowed to drop any \u003ci\u003ek\u003c/i\u003e of your test scores.\n\u003c/p\u003e\n\n\u003cp\u003e\nSuppose you take 3 tests with scores of 5/5, 0/1, and 2/6. Without dropping any tests, your cumulative average is 100 * (5+0+2) / (5+1+6) \u003d 50. However, if you drop the third test, your cumulative average becomes 100 * (5+0) / (5+1) ~\u003d 83.33 ~\u003d 83.\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\nThe input test file will contain multiple test cases, each containing exactly three lines. The first line contains two integers, 1 \u0026lt;\u003d \u003ci\u003en\u003c/i\u003e \u0026lt;\u003d 1000 and 0 \u0026lt; \u003ci\u003ek\u003c/i\u003e \u0026lt; n. The second line contains \u003ci\u003en\u003c/i\u003e integers indicating \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e for all \u003ci\u003ei\u003c/i\u003e. The third line contains \u003ci\u003en\u003c/i\u003e positive integers indicating \u003ci\u003eb\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e for all \u003ci\u003ei\u003c/i\u003e. It is guaranteed that 0 \u0026lt;\u003d \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e \u0026lt;\u003d \u003ci\u003eb\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e \u0026lt;\u003d 1, 000, 000, 000. The end-of-file is marked by a test case with \u003ci\u003en\u003c/i\u003e \u003d \u003ci\u003ek\u003c/i\u003e \u003d 0 and should not be processed. For example:\n\n\u003c/p\u003e\u003cpre\u003e3 1\n5 0 2\n5 1 6\n4 2\n1 2 7 9\n5 6 7 9\n0 0\n\u003c/pre\u003e\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\nFor each test case, write a single line with the highest cumulative average possible after dropping \u003ci\u003ek\u003c/i\u003e of the given test scores. The average should be rounded to the nearest integer. For example:\n\n\u003c/p\u003e\u003cpre\u003e83\n100\n\u003c/pre\u003e\n\u003cp\u003e\u003c/p\u003e\n\n\u003cp\u003e\nTo 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).\n\u003c/p\u003e\n\n"}}]}