2022.02.17翻译TrDie Roll

Die Roll
题目(https://acs.jxnu.edu.cn/problem/CF9A)描述:
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.

输入:
The only line of the input file contains two natural numbers Y and W — the results of Yakko's and Wakko's die rolls.

输出:
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».

样例输入:
4 2
样例输出:
1/2
注释:
Dot will go to Transylvania, if she is lucky to roll 4, 5 or 6 points.

翻译:
世界著名三宝Yakko, Wakko 和 Dot,决定从动画界退下来去休息,并且去旅游。Yakko想去他和他祖先的故乡Pennsylvania。Wakko想去Tasmania享受那里的沙滩,阳光和大海。Dot 选择 Transylvania作为最神秘和不可预知的地方。

但是让他们非常遗憾的是,他们只能离开一段很短的时间,只能去上面三个地方中的任何一个地方。Yakko,作为他们三个中最聪明的人,想出了一个真的智慧的主意:掷色子,三个人每人一枚六面掷色子,点数最大的人获胜,带另外两人去他想去的地方。

Yakko掷色子,点数为y,Wakko点数为w。现在轮到Dot,但是她并不着急。Dot想知道她能去Transylvania的概率。

已知Yakko 和 Wakko都非常绅士,如果Dot的点数和他们的一样,他们会让Dot胜利。

输入:
输入只有一行包含两个自然数y和w,表示Yakko 和 Wakko的点数。
输出:
输出Dot获胜的概率,以《A/B》的形式。A是分子B是分母。如果概率为0,输出《0/1》。如果概率为1,输出《1/1》。
样例输入:
4 2
样例输出:
1/2
注释:
Dot的点数如果为4或5或6,她就能去Transylvania。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值