SP2856 HELPBOB - Help Bob

Description

Bob loves Pizza but is always out of money. One day he reads in the newspapers that his favorite pizza restaurant, Alfredo's Pizza Restaurant, is running a competition: they will donate a big pizza to the first person who will tell them the lowest price per area that can be achieved by buying any of the pizzas at most once. "That task is easy!", thinks Bob, "For each pizza I just calculate the average price and the lowest quotient will be the answer.". Unfortunately the problem is a bit more complicated: with some pizzas Alberto gives out discount coupons for getting another pizza cheaper and even worse, those coupons can be combined. The pizzas have to be bought one after the other, and it is not possible to use a coupon to get a discount retrospectively for a pizza which has already been bought. Can you help Bob to become the first to solve this task and to get a pizza for free?

Input Format

The input file contains several test cases. Each test case starts with a number _m_, the number of pizzas Alfredo offers. Input is terminated by _m=0_. Otherwise, _1 . Then follow _m_ lines describing the pizzas. Each of those following lines describes pizza _i_ (_1 ) and starts with 3 integer numbers _p $ _{i} $_ , _a $ _{i} $_ and _n $ _{i} $_ specifying the price of the pizza, its area and the number of discount coupons you get when buying it, _1 , _1 and _0 . Then follow _n $ _{i} $_ pairs of integer numbers _x $ _{i,j} $_ and _y $ _{i,j} $_ specifying the index _x $ _{i,j} $_ (_1 ) of the pizza you get a discount coupon for and the discount in percentage terms _y $ _{i,j} $_ (_1 ) you get when buying pizza _x $ _{i,j} $_ . You may assume that for each _i_ the values _x $ _{i,j} $_ are pairwise distinct._______

Output Format

For each test case print one line containing the lowest price per area that can be achieved by buying any of the pizzas at most once. Round this number to 4 places after the decimal point. Note that you can combine an arbitrary number of discount coupons: for a pizza with price 10 and two rabatt coupons for that pizza with a 50 and a 20 on it, you would only have to pay 10 \* 0.8 \* 0.5 = 4 monetary units.