P27912 [洛谷] [Language Month Competition 202402] Wine
普及-
题目描述

Problem Background

In the game developed by the "King of Rollers," there are three Li Bai characters. They come to a small tavern to drink together.

Problem Description

A small barrel contains $x$ liters of wine, and a large barrel contains $y$ liters of wine.

Li Bai with the number $1$ first drinks $a$ small barrels of wine, then drinks $b$ large barrels of wine.
Li Bai with the number $2$ drinks $c$ large barrels of wine.
Li Bai with the number $3$ drinks $d$ large barrels of wine and $e$ liters of wine.

Which Li Bai drinks the most wine?

Input Format

The input consists of a single line with seven floating-point numbers $a, b, c, d, e, x, y$.

Output Format

Output a single line containing an integer and a floating-point number, representing the number of the Li Bai who drinks the most wine and the amount of wine they drank (in liters, rounded to two decimal places). The two numbers should be separated by a space.

If multiple Li Bai drink the same amount of wine, output the one with the smallest number.

Sample Input and Output

Sample Input #1

1 2 3 4 5 10 20

Sample Output #1

3 85.00

Sample Input #2

242.08 2.9 16.85 7.75 27.27 1593.91 1812.2

Sample Output #2

1 391109.11

Notes

Sample 1 Explanation

The first Li Bai drinks $1 \times 10 + 2 \times 20 = 50$ liters of wine; the second Li Bai drinks $3 \times 20 = 60$ liters of wine; the third Li Bai drinks $4 \times 20 + 5 = 85$ liters of wine. The third Li Bai drinks the most wine, so the output is 3 85.00.

Data Range and Constraints

  • For $50\%$ of the data, $0 < a, b, c, d, e, x, y \leq 10^3$.
  • For $100\%$ of the data, $0 < a, b, c, d, e, x, y \leq 10^7$.

The input floating-point numbers have no more than 4 decimal places.

Since the tavern allows storing wine, the Li Bai can drink partially from some barrels (drinking half, three-quarters, or $\frac{1}{3.14 \cdots}$ of a barrel is possible), so $a, b, c, d$ can also be fractional.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 2 3 4 5 10 20
样例输出
3 85.00