#P8507. 毕业后

    ID: 9533 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>数学洛谷原创Special Judge洛谷月赛

毕业后

Background

After graduation, classmates are discussing their high school plans enthusiastically. Everyone can hardly avoid one topic—the academic proficiency test.

In Zhejiang, besides taking the National College Entrance Examination (commonly called the Gaokao), high school students also need to take the General High School Academic Proficiency Test (commonly called the Xuekao). Students take the Xuekao once in the second semester of Grade 10, once in the first semester of Grade 11, and once in the second semester of Grade 11.

Problem Description

Note: Some parts of the description in this problem may differ from reality.

The Xuekao tests all high school subjects and rates students by level according to their scores, from high to low as A to E. For each subject, a fixed ratio ww (the same for all subjects) is used to determine how many students receive level E. If a student gets level E (fail) in more than one subject in the Xuekao, then the student cannot graduate.

In another parallel world, high school has a total of aa subjects. There are bb examinees in the whole province. If the cutoff for level E is too high, it may cause the situation that there will always be some people who cannot graduate. Now, the director of the examination authority has come to you and hopes you can determine the maximum possible proportion of level E among all examinees (that is, maximize the value of ww), such that there exists at least one arrangement that allows all examinees in Zhejiang to graduate.

If the number of level E examinees computed under a certain ratio is not an integer, then round up the number of examinees.

Input Format

One line containing two positive integers a,ba, b.

Output Format

Output a floating-point number representing the maximum proportion of level E.

This problem uses a custom checker. Any answer with an absolute error within 10610^{-6} compared to the standard answer is considered correct.

2 2
0.5000000000000000
114 514
0.0077821011673152
191 9810
0.0051987767584098

Hint

Explanation for Sample 1

Set the level E ratio to 12\frac{1}{2}. Then, in each subject, exactly one examinee fails. When the first examinee fails the first subject and the second examinee fails the second subject, all examinees can graduate. Therefore, 12\frac{1}{2} satisfies the requirement.

It can be proven that there is no better solution.

Data Scale and Constraints

For all data, 1a,b100001\le a, b\le 10000.

$$\def\arraystretch{1.5} \begin{array}{|c|c|}\hline \bf{Test Point} & \bf{Special Property} \\ \hline 1\sim3 & b=1\\\hline 4\sim6 & a=b \\\hline 7\sim10 & /\\\hline \end{array}$$

After finishing this problem, can you explain why, in reality, the proportion of level E in Zhejiang cannot exceed 5%5\%?

Translated by ChatGPT 5