logo AlgoBeat OnlineJudge
登录 注册

#206144. [NEERC 2014] Burrito King(征集SPJ)

内存限制:128 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Two friends Albert and Barney came to the newly opened restaurant Burrito King. The restaurant had opened just yesterday, and Albert has got a special gift card, which allows the friends to get a free burrito. However, there is a constraint on the amount of ingredients -- the burrito can contain at most grams of ingredient for all from to

There are two satisfaction parameters and for each ingredient -- the amount of Albert's joy per gram of the corresponding ingredient, and the amount of Barney's unhappiness per gram, correspondingly.

Therefore, the total Albert's joy from the burrito is equal to:

Double subscripts: use braces to clarify\[\su_m_{i=1}^{n}{s_i \cdot a_i}\]

The total Barney's unhappiness from the burrito is equal to:

Double subscripts: use braces to clarify\[\su_m_{i=1}^{n}{s_i \cdot b_i}\]

Here is the number of grams of the ingredient in the burrito. Note, that is not necessarily an integer, and

Albert wants to make his total joy from the burrito to be at least Barney is his best friend, so Albert wants Barney's total unhappiness to be no more than Among all possible burritos that satisfy the above constrains, Albert wants to choose one that maximises his total joy.

Your task is to help Albert to choose to satisfy these conditions or to find out that there is no solution.

输入格式

The first line contains three integers and the number of ingredients, the least amount of Albert's joy and the maximal amount of Barney's unhappiness. Each of the following lines contains a description of an ingredient: three integers -- the maximal number of grams allowed, the amount of Albert's joy per gram and the amount of Barney's unhappiness per gram.

输出格式

The first line of the output must contain two real numbers -- the maximal amount of his joy and the amount of Barney's unhappiness that Albert can obtain, satisfying the conditions in the problem statement, or if Albert cannot satisfy the conditions.

If the conditions are satisfiable the second line must contain real numbers -- the amount of each ingredient in grams.

Your output must have an absolute or relative error of at most .

Any way to reach maximal Albert's joy that satisfies the given conditions can be printed.

样例

样例输入 1

2 5 5
2 2 1
2 2 4

样例输出 1

5.5 5
2 0.75

样例输入 2

2 5 5
2 2 2
2 2 4

样例输出 2

-1 -1

数据范围与提示

Time limit: 1 s, Memory limit: 256 MB.