#P8507. Maximizing the E Grade Failing Ratio for Graduation

    ID: 21680 Type: Default 1000ms 256MiB

Maximizing the E Grade Failing Ratio for Graduation

Maximizing the E Grade Failing Ratio for Graduation

In a certain high school entrance exam, students are graded in each subject from A to E (from highest to lowest). A fixed ratio \(w\) is used for each subject to determine the number of students who receive an E grade. If a student receives an E in more than one subject, they cannot graduate.

In an alternate scenario, there are \(a\) subjects in high school and \(b\) students in the province. For each subject, the number of E grades is determined as \(\lceil b\times w \rceil\) (i.e. if \(b\times w\) is not an integer, round up to the nearest integer). In order for all students to have a chance to graduate (i.e. to ensure that there exists at least one assignment of the E grades such that no student receives more than one E), it is necessary that the total number of required E grades across all subjects does not exceed \(b\) (because each student can bear at most one E grade).

This condition can be written as:

[ a\times \lceil b\times w \rceil\le b ]

Your task is to determine the maximum ratio \(w\) for which there exists a valid assignment of E grades across all subjects, so that every student can graduate. Formally, given two positive integers \(a\) and \(b\), find the maximum \(w\) such that there exists an assignment where every student receives at most one E grade. It turns out that the maximum ratio is achieved when:

[ w_{max} = \frac{\lfloor \frac{b}{a} \rfloor}{b} ]

</p>

inputFormat

The input consists of a single line with two space-separated positive integers \(a\) and \(b\), where:

  • \(a\) is the number of subjects.
  • \(b\) is the total number of students.

outputFormat

Output the maximum possible ratio \(w\) as a floating point number. The answer is defined as \(w_{max} = \frac{\lfloor \frac{b}{a} \rfloor}{b}\). It is recommended to print the result with 6 decimal places.

sample

3 10
0.300000