405371: GYM101917 D Freddy and minifier

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Freddy and minifiertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Freddy has a very big elephant, Simon. He is flying to Gabon in order to let Simon meet his brothers and sisters, however he is very big, which means he doesn't really fit in the plane. In order to make him fit Freddy needs to minify his size. In order to do that he has N minifying guns (they make stuff smaller). However, each gun can only be used once. Each gun has a cost of using it c*w, where c is unique per gun and w is the weight of the thing they are minifying. Additionally each gun has a minify ratio called r, which means that the size and weight get reduced to r percent of the original value. Given that the initial weight of Simon is W and he is going to get shrunk by each of the N guns exactly once, what is the minimum cost of doing this?

Input

Two integers, N and W ($$$1<=N<=10{^5}, 1<=W<=10{^4}$$$). Followed by N lines each with an integer, c ($$$1<=c<=10{^4}$$$) and a real number r ($$$0<=r<=1$$$), the c and r values of the ith gun.

Output

A real number, the minimum cost of minifying Simon with each of the N guns exactly once. Your answer will be considered correct if its relative or absolute error doesn't exceed $$$10{^-6}$$$

ExamplesInput
2 1
7 0.5
9 0.2
Output
10.400000000000
Input
2 1
7 0.5
90 0.2
Output
52.000000000000

Source/Category

加入题单

上一题 下一题 算法标签: