#D4491. Fractional Knapsack

    ID: 3731 Type: Default 1000ms 134MiB

Fractional Knapsack

Fractional Knapsack

Problem statement

Real variables x1,x2,...,xN x_1, x_2, ..., x_N satisfy the following conditions.

  1. 0 leqxi leq1 0 \ leq x_i \ leq 1 (1 leqi leqN 1 \ leq i \ leq N )
  2. w1x1+w2x2+...+wNxN leqW w_1x_1 + w_2x_2 + ... + w_Nx_N \ leq W

At this time, find the maximum value that v1x1+v2x2+...+vNxN v_1x_1 + v_2x_2 + ... + v_Nx_N can take. It is known that such a maximum actually exists.

Constraint

  • 1 leqN leq105 1 \ leq N \ leq 10 ^ 5
  • 1 leqW leq105 1 \ leq W \ leq 10 ^ 5
  • 104 leqwi leq104 -10 ^ 4 \ leq w_i \ leq 10 ^ 4
  • 104 leqvi leq104 -10 ^ 4 \ leq v_i \ leq 10 ^ 4

input

Input follows the following format. All given numbers are integers.

N N W W w1 w_1 v1 v_1 w2 w_2 v2 v_2 ... ... wN w_N vN v_N

output

Output the maximum possible value of v1x1+v2x2+...+vNxN v_1x_1 + v_2x_2 + ... + v_Nx_N on one line. The output must not have an error greater than 103 10 ^ {-3} .

Examples

Input

1 1 3 1

Output

0.333333

Input

2 3 3 3 1 2

Output

4.000000

Input

2 1 -1 -3 3 10

Output

3.666667

inputFormat

input

Input follows the following format. All given numbers are integers.

N N W W w1 w_1 v1 v_1 w2 w_2 v2 v_2 ... ... wN w_N vN v_N

outputFormat

output

Output the maximum possible value of v1x1+v2x2+...+vNxN v_1x_1 + v_2x_2 + ... + v_Nx_N on one line. The output must not have an error greater than 103 10 ^ {-3} .

Examples

Input

1 1 3 1

Output

0.333333

Input

2 3 3 3 1 2

Output

4.000000

Input

2 1 -1 -3 3 10

Output

3.666667

样例

1 1
3 1
0.333333