#P2240. 【深基12.例1】部分背包问题

【深基12.例1】部分背包问题

Description

Alibaba walked into a treasure cave full of treasures. In the cave, there are N(N100)N(N \le 100) piles of gold coins. For the ii-th pile, the total weight and total value are mi,vi(1mi,vi100)m_i,v_i(1\le m_i,v_i \le 100). Alibaba has a knapsack with capacity T(T1000)T(T \le 1000), but it may not be possible to pack all the gold coins. He wants to take away gold coins with as much total value as possible. All gold coins can be divided freely, and after dividing, the value-to-weight ratio (i.e., the unit price) stays the same. Find the maximum total value of gold coins that Alibaba can take away.

Input Format

The first line contains two integers N,TN, T.

The next NN lines each contain two integers mi,vim_i, v_i.

Output Format

Output one real number as the answer, printed to two decimal places.

4 50
10 60
20 100
25 100
15 45

240.00

Hint

Translated by ChatGPT 5