eolymp
bolt
Try our new interface for solving problems
Problems

Golden sand

Golden sand

During robbery in a store a thief found n boxes with golden sand. All the sand in a box number i has the cost vi and the weight wi. To carry the stolen sand, thief uses a knapsack. Find the highest total cost of sand that the robber can carry out, if knapsack capacity is limited to w.

One can pour from the boxes any amount of sand, while the ratio of the cost of the poured sand to the cost of the entire box is equal to the ratio of volume of the poured sand to the volume of entire sand box.

Input

The first line contains two integers n and w (1n1000, 1w106). Each of the next n lines contains two integers. The i-th line contains the price vi and weight wi of the sand in the i-th box. All numbers are non-negative and do not exceed 106.

Output

Print the desired maximum cost with 3 digits after the decimal point.

Time limit 1 second
Memory limit 128 MiB
Input example #1
3 50
60 20
100 50
120 30
Output example #1
180.000