Accepted ratio

Given a submission log, ignore the administrator, count solvers and the rejections each made before their first accepted submission, then print the accepted ratio with 10 decimals.

Easy3ImplementationHash mapMathSimulationNo attempts yetTime limit2sMemory limit512 MB

Problem

An online judge computes the accepted ratio of each problem with this formula.

AA+W×100\frac{A}{A + W} \times 100

AA is the number of people who solved the problem, and WW is the total number of rejected submissions those people sent before their own first accepted submission. A submission counts as rejected when its verdict is anything other than accepted. Submissions from the administrator account are dropped from the whole calculation. If nobody outside the administrator solved the problem, the denominator is 00 and the accepted ratio is 00.

The submission log of one problem is given. Write a program that computes its accepted ratio.

Input

The first line contains the total number of submissions NN (1N2000001 \le N \le 200\,000).

Each of the next NN lines holds one submission, in increasing order of judge number. A line has seven values separated by single spaces, in this order.

  • Judge number: an integer between 11 and 80000008\,000\,000. The judge number is the submission order, and no two submissions share one.
  • User id: a string of length at most 2020 made of uppercase letters, lowercase letters, digits and underscores (_). Ids that differ in letter case belong to different people. The id megalusion is the administrator.
  • Verdict: an integer between 44 and 1111 with these meanings.
    • 44: accepted
    • 55: wrong output format
    • 66: wrong answer
    • 77: time limit exceeded
    • 88: memory limit exceeded
    • 99: output limit exceeded
    • 1010: runtime error
    • 1111: compile error
  • Memory used: an integer between 00 and 30000003\,000\,000.
  • Running time: an integer between 00 and 200000200\,000.
  • Language: an integer between 00 and 100100.
  • Code length: an integer between 11 and 524288524\,288.

Output

Print the accepted ratio on the first line with exactly 1010 digits after the decimal point. Round at the eleventh digit after the point, and round up when the value sits exactly halfway between two results. The count of digits after the point is always 1010, so a ratio of exactly 5050 prints as 50.0000000000.

Integer arithmetic gives the exact value: divide A×100×1010A \times 100 \times 10^{10} by A+WA + W and round the quotient.