This page is still under construction.

Parts of this page are still being built. What you see may change.

Race

Time limit1sMemory limit512 MB

Summary
Find the length-m segment of the road that minimizes total riding time under piecewise constant speed limits.
Level

Medium6 of 10

Topics
Sliding window, Prefix sum, Two pointers
Solved
No attempts yet

Problem

The Tour de Bajtocja race is held every year on a road that runs from city A to city B. This year, because of a budget shortfall, the race will take place on only one segment of the road. Which segment it will be has not been decided yet, but the length of that segment is already fixed.

Speed-limit signs are placed along the road. The limit set by a sign stays in force until the next sign sets a new limit. In this race the speed limits must always be obeyed, so when the limit at some place is vv, crossing a stretch of length ℓ\ell there takes time ℓ/v\ell / v.

The organizers are wondering where to place the segment of length mm so that, while obeying the speed limits, it can be ridden as fast as possible. Write a program that finds the shortest time needed to ride such a segment.

Input

The first line contains three integers nn, mm, and dd separated by single spaces (1≤n≤1061 \le n \le 10^6, 1≤m≤d≤1091 \le m \le d \le 10^9): the number of signs on the road, the length of the segment on which the race will be held, and the total length of the road from A to B, respectively.

Each of the next nn lines describes one sign with two integers sis_i and viv_i (0≤si≤d0 \le s_i \le d, 1≤vi≤1061 \le v_i \le 10^6): the distance of the ii-th sign from city A and the speed limit that applies starting at that sign. It is guaranteed that 0=s1<s2<⋯<sn0 = s_1 < s_2 < \dots < s_n.

Output

Print, on a single line, the shortest time needed to ride a segment of length mm, rounded to exactly three digits after the decimal point. The chosen segment must lie entirely within the road from A to B (it may not start before A or end beyond B).

Hint

Explanation: For the sample input, the best segment starts at distance 22 from city A. The time to ride it is 250+240=9100=0.09\frac{2}{50} + \frac{2}{40} = \frac{9}{100} = 0.09.

Tip: To avoid rounding errors, use a double-precision floating-point type (double) and the standard routines for printing real numbers with a given precision.

Examples2

  1. Example 1

    Input
    3 4 7
    0 30
    2 50
    4 40
    
    Expected output
    0.090
    
  2. Example 2

    Input
    3 7 7
    0 30
    2 50
    4 40
    
    Expected output
    0.182