CF9A.Die Roll
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Yakko, Wakko and Dot, world-famous animaniacs, decided to rest from acting in cartoons, and take a leave to travel a bit. Yakko dreamt to go to Pennsylvania, his Motherland and the Motherland of his ancestors. Wakko thought about Tasmania, its beaches, sun and sea. Dot chose Transylvania as the most mysterious and unpredictable place.
But to their great regret, the leave turned to be very short, so it will be enough to visit one of the three above named places. That's why Yakko, as the cleverest, came up with a truly genius idea: let each of the three roll an ordinary six-sided die, and the one with the highest amount of points will be the winner, and will take the other two to the place of his/her dreams.
Yakko thrown a die and got Y points, Wakko — W points. It was Dot's turn. But she didn't hurry. Dot wanted to know for sure what were her chances to visit Transylvania.
It is known that Yakko and Wakko are true gentlemen, that's why if they have the same amount of points with Dot, they will let Dot win.
掷骰子
Yakko,Wakko和Dot是举世闻名的动画师,他们一行人决定暂时先放下自己手头上的工作,准备来一场说走就走的旅行。Yakko一直梦想去宾夕法尼亚,这是他祖先曾今故土。Wakko想要去塔斯马尼亚,去看看那边的海和沙滩。Dot选择区世界上最神秘不可测的特兰西瓦尼亚。
但遗憾的是,他们的旅程很短,他们三个人只够去以上说的其中一个地方。这就是为什么世界上最聪明的孩子Yakko想出了一个绝美的方案:让三个人分别掷一个六面的骰子,得分最高的人胜出。三个人会前往得分最高的一个人想去的地方。
Yakko掷了一个骰子,得分Y。Wakko得了W$分。现在是Dot的回合了。但她并没有急于掷骰子,她想要知道她到底有多少的机会可以去特兰西瓦尼亚游玩。
众所周知,Yakko和Wakko是两位绅士,这就是为什么如果他们和Dot的分数都相同的话,他们会把机会让给Dot。
感谢Macw提供翻译
输入格式
The only line of the input file contains two natural numbers Y and W — the results of Yakko's and Wakko's die rolls.
输入包含一行两个整数Y,W。表示Yakko和Wakko分别得到的分数。
输出格式
Output the required probability in the form of irreducible fraction in format «A/B», where A — the numerator, and B — the denominator. If the required probability equals to zero, output «0/1». If the required probability equals to 1, output «1/1».
输出一个分数形式的概率,型为A/B
。如果概率为零,输出0/1
即可。如果几率为1
,则输出1/1
。
输入输出样例
输入#1
4 2
输出#1
1/2
说明/提示
Dot will go to Transylvania, if she is lucky to roll 4, 5 or 6 points.
请注意,本题空间限制为64MB,是默认空间限制的二分之一。