Created
October 6, 2017 06:19
-
-
Save mhmoodlan/065975b19ff6666a8e630695ed0ce1a4 to your computer and use it in GitHub Desktop.
#ElementaryMath #Probability #Codeforces #Solved #Easy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://codeforces.com/contest/9/problem/A | |
#include <bits/stdc++.h> | |
#define ll long long | |
#define sz(v) ((int) ((v).size())) | |
#define clr(v, d) memset(v, d, sizeof(v)) | |
#define lp(i, n) for(int i = 0; i < (int)(n); ++i) | |
#define rep(i, v) for(int i = 0; i < sz(v); ++i) | |
using namespace std; | |
int y, w; | |
int main() { | |
cin>>y>>w; | |
int a = 6 - max(y, w) +1; | |
int b = 6; | |
if(a == 6) {cout << "1/1" << endl; return 0;} | |
for(int i = a; i > 1; i--) { | |
if(a % i == 0 && b % i == 0) { | |
a = a/i; | |
b = b / i; | |
} | |
} | |
if(a == 0) cout << "0/1" << endl; | |
else { | |
cout << a << "/" << b << endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment