编程介的小学生 2017-06-08 09:02 采纳率: 20.5%
浏览 810
已采纳

Penalty Kick

In 2028 year, China Football Team advanced into the final of the World Cup. What an exciting news! But the Manager of China is ZhuGuanghu's grandson, being conservative is their only style. As almost excepted, the final is boring, they don't even score one goal in 120 minutes! Now the match comes into penalty kick off. Here comes the official law of the penalty kick off:

  1. The referee chooses the goal at which the kicks will be taken

  2. The referee tosses a coin and the team whose captain wins the toss decides whether to take the first or the second kick

  3. The referee keeps a record of the kicks being taken

  4. Subject to the conditions explained below, both teams take five kicks

  5. The kicks are taken alternately by the teams

  6. If, before both teams have taken five kicks, one has scored more goals than the other could score, even if it were to complete its five kicks, no more kicks are taken

  7. If, after both teams have taken five kicks, both have scored the same number of goals, or have not scored any goals, kicks continue to be taken until one team has scored a goal more than the other from the same number of kicks

  8. No player is allowed to take a second kick until all other players in his team have taken a kick

You, assistant coach of China, have been working on the math particularly on probability for many years. You know everyone's success rate when taking a penalty in your team, and you also know the opponent's success rate (assume they have the same success rate). Now you will determine the order of taking the penalty to maximize the probability to win the World Cup.

Input

There are several test cases in the input. Each case contains 12 integers, from 0 to 100. The first 11 integers is the success rate of your teammates. The last integer is the success rate of the opponent.

Output

For each case, compute as accurately as possible the max possibility of your team to win the final, then output a single line containing percentage round to 0.0001

Sample Input

10 10 10 10 10 10 10 10 10 10 10 10
10 20 30 40 50 60 70 80 90 100 100 80
Sample Output

50.0000
52.1874

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-06-25 15:50
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建