<|instruction|>
Solve the below problem. The solution should start with an abridged problem statement. Then key observations. Then full solution based on the observations. Then C++ and Python implementations with comments.

144. Meeting

time limit per test: 0.25 sec.
memory limit per test: 4096 KB


Two of the three members of the winning team of one of the ACM regional contests are going to meet in order to train for the upcoming World Finals. They decided that they will meet sometime between X o'clock and Y o'clock. Because they never get anywhere on time (they were late even on the day of the regional contest), they did not set an exact time when they will meet. However, they decided that the one who gets first at the meeting point will not wait more than Z minutes for the other one (they calculated that, if the other one will not come within Z minutes from the arrival of the first of them, then it is very probable that he will not show up at all).
Knowing that, in the end, both of them will show up at some time between X o'clock and Y o'clock (not necessarily after an integer number of minutes), compute which is the probability that they will actually meet.


Input

The input will contain 2 integer numbers X and Y (0<=X<Y<=24) and one real number Z ( 0 < Z <= 60*(Y-X) ).


Output

You should output the required probability with 7 decimal digits (rounded according to the 8th decimal digit).


Sample Input

11 12 20.0
Sample Output

0.5555556
Author	: Mugurel Ionut Andreica
Resource	: SSU::Online Contester Fall Contest #2
Date	: Fall 2002

<|response|>
1. Abridged Problem Statement  
Two people plan to meet sometime between X hours and Y hours. Each arrives at a random time uniformly in [X, Y] (continuous). Whoever arrives first will only wait up to Z minutes for the other; if the other arrives later than that, they leave without meeting. Compute the probability that they actually meet. Print the result rounded to 7 decimal places.

2. Key Observations  
- Let T₁ and T₂ be the arrival times (in hours) of person 1 and person 2; they are independent and uniform on [X, Y].  
- They meet iff the difference in arrival times is at most Z minutes, i.e. |T₁−T₂| ≤ Z/60 (hours).  
- A common trick is to convert the time interval into minutes from 0 to δ, where δ = (Y−X)×60. Define U₁ = (T₁−X)×60 and U₂ = (T₂−X)×60; U₁,U₂∼Uniform[0,δ].  
- Geometrically, (U₁,U₂) is uniform over the square [0,δ]×[0,δ]. The meeting region is the band |U₁−U₂| ≤ Z.  
- The total area of the square is δ². The area where |U₁−U₂| > Z consists of two right triangles each with legs (δ−Z), so its area is 2·((δ−Z)²/2) = (δ−Z)².  
- Therefore the “meeting” area = δ² − (δ−Z)² = 2δZ − Z².  
- The probability = (2δZ − Z²) / δ² = 2·(Z/δ) − (Z/δ)².

3. Full Solution Approach  
1. Read integers X, Y and real Z.  
2. Compute δ = (Y − X) × 60.0 (total window size in minutes).  
3. If Z ≥ δ then they surely meet; probability = 1.0. Otherwise compute:  
     numerator   = 2 × δ × Z − Z²  
     denominator = δ²  
     probability = numerator / denominator  
4. Print probability to 7 decimal places (rounded).

Time complexity is O(1) and memory is O(1).

4. C++ Implementation with Detailed Comments  
```cpp
#include <bits/stdc++.h>
using namespace std;

int main() {
    // X, Y are hours (integers), Z is minutes (real)
    int X, Y;
    double Z;
    cin >> X >> Y >> Z;

    // Convert total meeting window from hours to minutes
    double delta = (Y - X) * 60.0;

    double probability;
    if (Z >= delta) {
        // If the maximum waiting time covers entire interval,
        // the first arriver will wait long enough for the second.
        probability = 1.0;
    } else {
        // Area-based formula: P = (2*delta*Z - Z^2) / (delta^2)
        double numerator   = 2.0 * delta * Z - Z * Z;
        double denominator = delta * delta;
        probability = numerator / denominator;
    }

    // Output with fixed format and 7 decimal places
    cout << fixed << setprecision(7) << probability << "\n";
    return 0;
}
```

5. Python Implementation with Detailed Comments  
```python
import sys

def main():
    # Read X, Y, Z from stdin
    data = sys.stdin.read().split()
    X, Y = map(int, data[:2])
    Z = float(data[2])

    # Convert meeting window length from hours to minutes
    delta = (Y - X) * 60.0

    # If waiting time Z covers or exceeds delta, meeting is certain
    if Z >= delta:
        probability = 1.0
    else:
        # Use the derived probability formula
        # success area = 2*delta*Z - Z^2
        # total area   = delta^2
        probability = (2.0 * delta * Z - Z * Z) / (delta * delta)

    # Print result rounded to 7 decimal places
    sys.stdout.write(f"{probability:.7f}\n")

if __name__ == "__main__":
    main()
```