Stupid people P45462


Statement
 

pdf   zip

The current pandemic has proven (once again) how many stupid people there are. Consider, for instance, the use of face masks, under this simplified model: The length of a face is \ell, with the bottom of the chin at position 0 and the top of the front at position \ell. The bottom of the mouth is at position mm, and the top of the nostrils is at position nn, with 0<m<n<0 < m < n < \ell.

Let us consider that a placement of a mask is defined by two real numbers: its bottom position b0b \ge 0 and its upper position uu \le \ell, where b<ub < u. We say that a placement is reasonable if it completely covers the mouth and the nostrils, that is, if bmb \le m and unu \ge n.

A stupid person just choses any possible placement such that 0b<u0 \le b < u \le \ell uniformly at random. Note that bb and uu are real numbers with an arbitrary (or infinite) number of decimals. What is the probability that a stupid person wears a mask in a reasonable way?

Input

Input consists of several cases, each with three real numbers mm, nn and \ell. You can assume 0<m<n<1060 < m < n < \ell \le 10^6.

Output

For every case, print the probability that a stupid person wears a mask in a reasonable way. Print four digits after the decimal point. The input cases do not have precision issues.

Public test cases
  • Input

    10 15 20
    1.62 2.72 3.14
    1 2 3
    

    Output

    0.2500
    0.1380
    0.2222
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C++ Python