A. Die roll

Source: Internet
Author: User
Time limit per test

1 second

Memory limit per test

64 megabytes

Input

Standard Input

Output

Standard output

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 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.

Input

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

Output the required probability in the form of irreducible fraction in format «a/B», where-
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 ».

Sample test (s) Input
4 2
Output
1/2
Note

Dot will go to Transylvania, if she is lucky to roll 4, 5 or 6 points.

Explanation: this is a simple probability question.

#include <iostream>#include <cstdio>#include <cstdlib>#include <cmath>#include <cstring>#include <string>#include <algorithm>using namespace std;int main(){int a,b;int left;scanf("%d %d",&a,&b);if(a>b){left=6-a+1;}else{left=6-b+1;}if(left==1){printf("1/6\n");}else if(left==2){printf("1/3\n");}else if(left==3){printf("1/2\n");}else if(left==4){printf("2/3\n");}else if(left==5){printf("5/6\n");}else if(left==6){printf("1/1\n");}return 0;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.