-->
当前位置:首页 > 题库

PROGRAMMING:Victory and defeat lottery

Luz5年前 (2021-05-10)题库391
The lucky lottery center has a new winning and losing lottery, called "three wins in a row". The rule is very simple: first, select any one of the three matches, and then for each selected match, guess one of the three possible results - that is, w stands for win, t stands for draw, and l stands for lose. Each result is given an odds. The winner's odds will be the product of three single odds multiplied by 65%.
For example, the odds for the three games are as follows:
W T L
1.1 2.5 1.7
1.2 3.1 1.6
4.1 1.2 1.1
In order to get the maximum profit, we have to buy w in the third game, t in the second game and T in the first game. If you bet 2 yuan each time, the maximum profit is (4.1 1 × three point one × two point five × 65%-1) × 2 = 39.31 yuan (accurate to 2 decimal places).
###Input format:
Each input contains a test case. The test case consists of three lines, corresponding to the odds of three games. Each line gives the odds of winning, equalizing and losing in each game in turn.
###Output format:
For each group of inputs, outputs, the best choice and the maximum possible gains. The income is accurate to two decimal places, and the choice and income are separated by spaces.
###Input example:
Here is a set of inputs. For example:
```in
1.1 2.5 1.7
1.2 3.1 1.6
4.1 1.2 1.1
```
###Output example:
The corresponding output is given here. For example:
```out
T T W 39.31
```







answer:If there is no answer, please comment