编程介的小学生 2017-06-08 09:02 采纳率: 20.3%
浏览 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 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)