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: Equations
Description Given 3 × n positive integers: A1, A2, A3, ... An; and a set of m pairs of integer < Si, Ti >, your task is to find a non-negative real solution for the following equations: A1X1 + A2X2 + A3X3 + ... + AnXn = Si that maximizes C1X1 + C2X2 + C3X3 + ... + CnXn Input The first line contains two numbers n (1 ≤ n ≤ 100000) and m (1 ≤ m ≤ 10000). Output For each pair < Si, Ti >, output the maximum value or IMPOSSIBLE if no solution exists. Sample Input 2 2 2 2 2 3 1 1 4 2 4 1 Sample Output 2.00000 IMPOSSIBLE Source POJ Founder Monthly Contest – 2008.08.31, Lei, Tao |
[Submit] [Go Back] [Status] [Discuss]
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator