Under construction

Still being built. Things may change

Bar "Duck"

Interview

Time limit5sMemory limit256 MB

Summary
Trash pieces on a table of length L must be flung off within T seconds using at most E energy; find the longest clean gap that can be made.
Level

Medium5 of 10

Topics
Two pointers, Array
Solved
No attempts yet

Problem

You're having a party at your place tonight! Some of your friends will come over, and you're going to spend the evening playing your favourite board game called 'Bar "Duck"'. But several minutes before the guests arrive, you discover that the only table suitable for playing is covered with trash of mysterious origin. You have no time for proper cleaning, so you will fling some of the trash pieces away so that at least part of the table is clean.

The table is long but very narrow, so its surface can be represented as a straight segment of length LL centimeters. The coordinate system is chosen so that one end of the table has coordinate 0 and the other end has coordinate LL. There are nn pieces of trash on the table. The ii-th piece is at coordinate xix_i and has mass mim_i grams.

You can fling any of the pieces, that is, give them an initial speed in either of the two directions along the axis. After a piece is flung, it moves at its initial speed with no acceleration or deceleration until it reaches an end of the table and falls to the floor. Pieces move independently and do not collide or interfere with each other. Applying a force costs energy: to make an object of mass mm grams move at speed vv centimeters per second, you must spend mv22\frac{mv^2}{2} units of energy.

The game starts exactly TT seconds from now. The game needs a lot of space, so at the start you will choose the longest segment of the table that contains no trash. You are tired after your day job, so you will not spend more than EE units of energy on flinging. You may give any speed to any piece, choosing each piece's speed independently, as long as the total energy does not exceed EE.

Find the length of the longest clean segment of the table you can obtain after TT seconds, spending no more than EE units of energy.

Input

The first line contains four space-separated integers nn, LL, TT, and EE (1≤n≤1051 \leq n \leq 10^5, 1≤L,T,E≤1061 \leq L, T, E \leq 10^6).

The next nn lines describe the trash pieces. The ii-th line contains two space-separated integers xix_i and mim_i (0<xi<L0 < x_i < L, 1≤mi≤1031 \leq m_i \leq 10^3), the position and mass of the ii-th piece. No two pieces occupy the same place, and the pieces are sorted by increasing xix_i.

Output

Print one real number, the length (in centimeters) of the longest clean table segment you can obtain after TT seconds while spending no more than EE units of energy. The answer is judged correct if its relative or absolute error compared to the jury's answer does not exceed 10−610^{-6}.

Hint

In the first test, we spend all energy to give the only piece a speed of 2\sqrt{2} centimeters per second, so after one second the longest clean segment has length 2+22 + \sqrt{2} centimeters.

In the second test, the optimal way is to make both pieces move at a speed of 1 centimeter per second in opposite directions.

Examples2

  1. Example 1

    Input
    1 4 1 1
    2 1
    
    Expected output
    3.4142135624
    
  2. Example 2

    Input
    2 6 1 1
    2 1
    4 1
    
    Expected output
    4.0000000000