With the 2010 FIFA World Cup running,

随着2010世界杯的举行

football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa.

世界各国的足球粉丝越加的激动,对于在南非世界杯的强强对决。

Similarly, football betting fans were putting their money where their mouths were, by laying all manner of World Cup bets.

同时,球迷会吧自己这个月的钱花在赌球上面

Chinese Football Lottery provided a "Triple Winning" game.

中国足球提供了一种叫TW的游戏

The rule of winning was simple: first select any three of the games.

规则很简单,先选任意三场比赛

Then for each selected game, bet on one of the three possible results -- namely W for win, T for tie, and L for lose.

之后每场比赛有三种可能的结果,win,tie,lose

There was an odd assigned to each result. The winner's odd would be the product of the three odds times 65%.

对于每个结果都已一个基数,最后胜利的基数是三个基数的65%

For example, 3 games' odds are given as the following:

 W    T    L
1.1 2.5 1.7
1.2 3.0 1.6
4.1 1.2 1.1

To obtain the maximum profit, one must buy W for the 3rd game, T for the 2nd game, and T for the 1st game.

If each bet takes 2 yuans, then the maximum profit would be (4.1*3.0*2.5*65%-1)*2 = 37.98 yuans (accurate up to 2 decimal places).

Input

Each input file contains one test case. Each case contains the betting information of 3 games.

Each game occupies a line with three distinct odds corresponding to W, T and L.

Output

For each test case, print in one line the best bet of each game, and the maximum profit accurate up to 2 decimal places.

The characters and the number must be separated by one space.

Sample Input

1.1 2.5 1.7
1.2 3.0 1.6
4.1 1.2 1.1

Sample Output

T T W 37.98
 
这道题翻译到一半就不想看了,求三个最大值,然后代入公式一算,打印结果,没技术含量不写了。
 

PAT1011的更多相关文章

  1. PAT1011:World Cup Betting

    1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...

  2. pat1011. World Cup Betting (20)

    1011. World Cup Betting (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Wit ...

随机推荐

  1. python unitest基本

    基本 import unittest class OneTest(unittest.TestCase): def setUp(self): self.verificationErrors = [] s ...

  2. C语言中的string.h中的内存字符串处理函数

    转载请注明出处:http://blog.csdn.net/zhubin215130/article/details/8993403 void *memcpy(void *dest, const voi ...

  3. 深入理解HTTP协议(转) 浏览器和服务器如何通信(HTTP协议)

    http协议学习系列 1. 基础概念篇 1.1 介绍 HTTP是Hyper Text Transfer Protocol(超文本传输协议)的缩写.它的发展是万维网协会(World Wide Web C ...

  4. IntelliJ IDEA 7.0 正式版注册机代码

    好神奇,第一次看见注册机的源代码,自己运行一下.可以是java IDE环境,也可以是配置好jdk的dos环境. 然后输入自己的用户名就可以获得相对应的注册码,输入到软件中即可. 仅供参考,请购买正版. ...

  5. PHP常用的预定义常量

    <?php echo 'PHP常用的预定义常量'.'<br><br>'; echo '当前php的版本为(PHP_VERSION):'.PHP_VERSION.'< ...

  6. Ansible9:条件语句【转】

    在有的时候play的结果依赖于变量.fact或者是前一个任务的执行结果,从而需要使用到条件语句. 一.when    有的时候在特定的主机需要跳过特定的步骤,例如在安装包的时候,需要指定主机的操作系统 ...

  7. MySQL 对于千万级的大表要怎么优化

    转自知乎 作者:哈哈链接:http://www.zhihu.com/question/19719997/answer/81930332来源:知乎著作权归作者所有,转载请联系作者获得授权. 很多人第一反 ...

  8. 关于WIFI DIRECT功能的

    http://processors.wiki.ti.com/index.php/WiFi_Direct_Configuration_Scripts#p2p_find      https://wire ...

  9. ios屏幕

    设备 屏幕尺寸 分辨率(pt) Reader 分辨率(px) 渲染后 PPI iPhone 3GS 3.5吋 320x480 @1x 320x480   163 iPhone 4/4s 3.5吋 32 ...

  10. 登录数据库后,use db很慢的问题

    mysql> use dbl Reading table information for completion of table and column names You can turn of ...