当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3871:Java Certification

Special Judge 特殊评判
题目描述
You have just completed Java Certification exam that contained n questions. You have a score card that explains your performance. The example of the scorecard is given below.

You have correctly answered 78 questions out of 87.
Basic Concepts100%
Declarations100%
Expressions83%
Classes and Interfaces92%
Multithreading75%
Collections93%


From this scorecard you can infer that the questions are broken down into m categories (in the above example m = 6). Each category contains ni questions (1 <= ni <= n), so that __poj_jax_start__\sum\limits_{i = 1}^m {n_i}__poj_jax_end__\sum\limits_{i = 1}^m {n_i}=n. You know that you have correctly answered k questions out of n (in the above example k = 78 and n = 87), so you can easily find the number of incorrect answers w = n - k (in the above example w = 9).
You do remember several questions that you were unsure about and you can guess what category they belong to. To figure out if your answers on those questions were right or wrong, you really want to know how many incorrect answers you have given in each category.
Let wi (0 <= wi <= ni) be the number of incorrect answers in i-th category, __poj_jax_start__\sum\limits_{i = 1}^m {w_i}__poj_jax_end__\sum\limits_{i = 1}^m {w_i}=w. From the scorecard you know the percentage of correct answers in each category. That is, for each i from 1 to m you know the value of 100(ni - wi)/ni rounded to the nearest integer. The value with a fractional part of 0.5 is rounded to the nearest even integer.
It may not be possible to uniquely find the valid values for wi. However, you guess that the questions are broken down into categories in a mostly uniform manner. You have to find the valid values of wi and ni, so that to minimize the difference between the maximum value of ni and the minimum value of ni. If there are still multiple possible values for wi and ni, then find any of them.
输入解释
The first line of the input file contains three integer numbers - k, n, and m, where k (0 <= k <= n) is the number of correctly answered questions, n (1 <= n <= 100) is the total number of questions, m (1 <= m <= 10) is the number of question categories. The following m lines of the input file contain one integer number from 0 to 100 (inclusive) on a line - percentages of the number of the correct answers in each category. The input file always corresponds to some valid set of wi and ni.
输出解释
Write to the output file m lines with two integer numbers wi and ni on a line, separated by a space - the number of incorrect answers and the total number of questions in each category, satisfying constraints as given in the problem statement.
输入样例
78 87 6
100
100
83
92
75
93
输出样例
0 13
0 13
3 18
1 13
4 16
1 14

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3871

最后修改于 2020-10-29T07:14:10+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000 65536