You are planning a heist with access to $$$n$$$ valuable items stored in a warehouse. Each item has:
Your backpack can carry at most $$$W$$$ units of weight. Here's the twist: you're allowed to take fractions of any item — you can slice gold bars or siphon oil if needed. Your goal is to maximize the total value of what you carry, without exceeding the weight limit.
The first line contains two integers $$$n$$$ and $$$W$$$ ($$$1 \leq n < 2 \cdot 10^5$$$, $$$1 \leq W \leq 10^9$$$) — the number of items and the maximum weight that can be carried.
Each of the next $$$n$$$ lines contains two integers $$$v_i$$$ and $$$w_i$$$ ($$$1 \leq v_i, w_i \leq 10^5$$$) — the value and weight of the $$$i$$$-th item.
Print a single floating-point number — the maximum total value you can carry. Your answer will be considered correct if $$$ \frac{| \text{correct answer} - \text{your answer} |}{ \text{correct answer} } \leq 10^{-6} $$$
Input:
3 10 6 3 4 2 10 5
Output:
20.000000
Input:
3 10 40 20 100 50 30 30
Output:
20.000000
In TestCase 1