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. beego: 获取request参数

    beego提供了一套web开发的框架.但我们在开发过程中遇到了一些问题,现汇总如下. 测试1:测试只有keys数组的情况 func (this *TestController) Index() { k ...

  2. Linux设置静态IP【转】

    一只小码 2016-08-16 10:32 测试服务器OS: Centos 6.5 x64 本机OS: Ubuntu 14.04 x64 由于Virtualbox当时安装Centos 6.5的时候设置 ...

  3. 安装apache服务出错,无法启动此程序,因为计算机中丢失VCRUNTIME140.dll 尝试重新安装此程序以解决此问题

    错误信息:无法启动此程序,因为计算机中丢失VCRUNTIME140.dll 尝试重新安装此程序以解决此问题 错误场景:在使用["D:\Program Files\httpd-2.4.20-x ...

  4. Inno Setup入门(八)——有选择性的安装文件

    这主要使用[Components]段实现,一个演示的代码如下: [setup] ;全局设置,本段必须 AppName=Test AppVerName=TEST DefaultDirName=" ...

  5. Java 类的加载过程(阿里面试题)

    问以下程序打印出什么内容: 问题及解析如下: /** * 加载方法不等于执行方法,初始化变量则会赋值 * 类加载顺序应为 加载静态方法-初始化静态变量-执行静态代码块 * 实例化时 先加载非静态方法- ...

  6. web服务器小记

    服务器分web服务器,应用程序服务器以及HTTP服务器,此处只解释web服务器,详情: http://www.cnblogs.com/zhaoyl/archive/2012/10/10/2718575 ...

  7. jsp提交表单问题

    以form形式提交的话 String usernameInForm = hreq.getParameter("username");String passwordInForm = ...

  8. C# tostring()汇总

    原文:http://www.cnblogs.com/xiaopin/archive/2010/11/05/1870103.html C 货币 2.5.ToString("C") ¥ ...

  9. php array_walk_recursive函数的使用

    <?phpfunction myfunction($value,$key) {echo "The key $key has the value $value<br />&q ...

  10. JavaScript(2)——对象属性、原型与原型链

    对象属性.原型与原型链 哈哈哈,我的第二篇博客哟,说的是对象属性.原型与原型链.可能这些只是某些小点串联起来的,逻辑性没有很强.所以会对文章的可读性和理解性带来一些困扰.不过,今天我又前进了那么一小步 ...