405371: GYM101917 D Freddy and minifier
Description
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?
InputTwo 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.
OutputA 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}$$$
ExamplesInput2 1Output
7 0.5
9 0.2
10.400000000000Input
2 1Output
7 0.5
90 0.2
52.000000000000