当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1280:Game

题目描述
Recently, there was an international volleyball championship. Speaking of volleyball, we are interested in the probability of winning of one or another team, if we know some information about the teams. Here are the rules of the game and the necessary information:

  • the match is played by two teams: A and B;
  • the first team to win K games in a match, wins the match;
  • each game consists of rounds; each round is won by one of the teams, and the team adds one point to its score for the current game;
  • the first team to win L points in a game, wins the game;
  • if team A serves the ball in a round, it has Pa% chance to win the round (and (100-Pa)% to loose it);
  • if team B serves the ball in a round, it has Pb% chance to win the round (and (100-Pb)% to loose it);
  • if a round is not the first in a game, the ball in the round is served by the team that won the last round;
  • if a game is not the first in a match, the ball in the first round of the game is served by the team that did not served the ball in the first round of the previous game;
  • both teams have an equal chance to serve the ball in the first round of the very first game of a match.
    So, for given values of Pa, Pb, K, and L, you have to compute the probability, as a percent, for team A to win the match.
输入解释
There is one number in the first line ? the number of data sets. Each data set consists of a single line with four integers on it: Pa, Pb, K, and L (1<= K<=100, 1<= L<=100).
输出解释
For each test you must write on one line the required result with exactly one digit after the decimal point (the number should be rounded to the first digit after the decimal point).
输入样例
2
100 50 1 3
100 1 1 1
输出样例
93.8
99.5

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-1280

最后修改于 2020-10-29T05:59:56+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000