测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A8475. Growing Mushrooms

编程题 普及/提高-

题目描述

The first input line contains four integer numbers $n$ , $t_{1}$ , $t_{2}$ , $k$ $(1<=n,t_{1},t_{2}<=1000; 1<=k<=100)$ — the number of participants, the time before the break, the time after the break and the percentage, by which the mushroom growth drops during the break, correspondingly.

Each of the following $n$ lines contains two integers. The $i$ -th $(1<=i<=n)$ line contains space-separated integers $a_{i}$ , $b_{i}$ $(1<=a_{i},b_{i}<=1000)$ — the speeds which the participant number $i$ chose.

输入格式

Print the final results' table: $n$ lines, each line should contain the number of the corresponding dwarf and the final maximum height of his mushroom with exactly two digits after the decimal point. The answer will be considered correct if it is absolutely accurate.

输出格式

- First example: for each contestant it is optimal to use firstly speed 2 and afterwards speed 4, because $2·3·0.5+4·3>4·3·0.5+2·3$ .

输入输出样例

输入 #1
2 3 3 50
2 4
4 2
输出 #1
1 15.00
2 15.00
输入 #2
4 1 1 1
544 397
280 101
280 101
693 970
输出 #2
4 1656.07
1 937.03
2 379.99
3 379.99

说明/提示

- First example: for each contestant it is optimal to use firstly speed 2 and afterwards speed 4, because $2·3·0.5+4·3>4·3·0.5+2·3$ .
上一题 去做题 下一题