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. 用jQuery写的最简单的表单验证

    近几天完成了关于我们项目的最简单的表单验证,是用jQuery写的,由于之前也一直没学过jQuery,所以自己也是一直处于边摸索边学习的阶段,经过这一段时间的学习,通过查资料啥的,也发现了学习jQuer ...

  2. json格式数据,将数据库中查询的结果转换为json, 然后调用接口的方式返回json(方式一)

    调用接口,无非也就是打开链接 读取流 将结果以流的形式输出 将查询结果以json返回,无非就是将查询到的结果转换成jsonObject ================================ ...

  3. Autofac 组件、服务、自动装配(2)

    一.组件 创建出来的对象需要从组件中来获取,组件的创建有如下4种(延续第一篇的Demo,仅仅变动所贴出的代码)方式: 1.类型创建RegisterType AutoFac能够通过反射检查一个类型,选择 ...

  4. unlinking

    When a file name is deleted from the directory tree, the file name's connection to the inode number ...

  5. oc拨打电话

    判断当前设备是否支持电话功能 +(int)isCanCall{ if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad || [[[UIDevi ...

  6. liunx 内存文件 tmpfs

    tmpfs是Linux/Unix系统上的一种基于内存的文件系统.tmpfs可以使用您的内存或swap分区来存储文件 1 创建将被挂载的文件 mkdir /tmp/tmpfs/ 2 写入测试文件内容.大 ...

  7. QT插件和服务培训

    下载地址:http://files.cnblogs.com/files/senior-engineer/%E6%8F%92%E4%BB%B6%E5%92%8C%E6%9C%8D%E5%8A%A1%E5 ...

  8. adb 卸载android系统程序

    下面是通过 pm list packages -f 列出手机中的软件,然后跟模拟器中的软件进行对比后得出的可以安全卸载的列表.   注意:卸载之后就没有Google Market了,还想用google ...

  9. 常用 SQL语句

    Oracle 查看所有表的名字: select table_name from user_tables; 查询特定表的名字:select * from (select table_name t fro ...

  10. wpf之数据触发器DataTrigger

    wpf, 根据绑定的属性的值的不同(数据分类),界面上显示不同的控件(绑定不同类型的属性),可以使用数据库触发器DataTrigger实现这一功能. 实现的效果如下: 首先建立实体类: 更改通知类: ...