Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: The lazy programmer
Description A new web-design studio, called It is known that the programmer is lazy. Usually he does not work as fast as he could. Therefore, under normal conditions the programmer needs bi of time to perform the contract number b − _{i}a _{i}x) of time to do his job. But this extra payment does not influent other contract. It means that each contract should be paid separately to be done faster. The programmer is so greedy that he can do his job almost instantly if the extra payment is (_{i}b ⁄ _{i}a) dollars for the contract number _{i}i.The director has a difficult problem to solve. He needs to organize programmer’s job and, may be, assign extra payments for some of the contracts so that all contracts are performed in time. Obviously he wishes to minimize the sum of extra payments. Help the director! Input The first line of the input contains the number of contracts b, _{i}d (1 ≤ _{i}a, _{i}b ≤ 10 000; 1 ≤ _{i}d ≤ 1 000 000 000) separated by spaces._{i}Output The output needs to contain a single real number Sample Input 2 20 50 100 10 100 50 Sample Output 5.00 Source Northeastern Europe 2004, Western Subregion |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator