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)决定暂时告别卡通片的拍摄工作,休个短假去旅行一番。雅克梦想前往宾夕法尼亚州——他的祖国,也是他祖先的故土;瓦克则向往塔斯马尼亚岛,那里有海滩、阳光与大海;而多特选择了特兰西瓦尼亚,因为那里是最神秘、最不可预测的地方。
然而令他们深感遗憾的是,假期非常短暂,只够三人一同前往上述三地中的一个。因此,作为三人中最聪明的雅克,想出了一个真正天才的主意:每人掷一枚标准的六面骰子,点数最高者获胜,并带另外两人前往自己梦想的地方。
雅克掷出了 $ Y $ 点,瓦克掷出了 $ W $ 点。现在轮到多特掷骰子了。但她并不着急——她想确切地知道自己能去特兰西瓦尼亚的概率是多少。
已知雅克和瓦克都是真正的绅士,因此若多特掷出的点数与其中任何一人相等,他们都会主动让多特获胜。
输入格式
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」,其中 A 为分子,B 为分母。如果所求概率等于 0,则输出「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.
如果 Dot 掷出 4、5 或 6 点,她将前往特兰西瓦尼亚。
输入解题思路,AI测评打分。不知道怎么写?