#include #define For(i, a, b) for(long long i = a; i < b; i++) #define rep(i, n) For(i, 0, n) #define rFor(i, a, b) for(long long i = a; i >= b; i--) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; int INF = 2000000000; lint LINF = 1000000000000000000; struct Fraction { using lint = long long; private: lint gcd(lint x, lint y) { if (y == 0) { return x; } return gcd(y, x % y); } void reduce() { if (p != 0) { lint g = gcd(abs(p), abs(q)); p /= g; q /= g; } else { q = 1; } } int comp(lint a, lint b, lint c, lint d) const { if (a == c && b == d) { return 0; } return (a * d < c * b ? -1 : 1); } public: lint p, q; Fraction() : p(0), q(1) {} Fraction(lint p_, lint q_) : p(p_), q(q_) { assert(q_ != 0); if (q < 0) { p = -p; q = -q; } reduce(); } Fraction(lint p_) : p(p_), q(1) {} Fraction &operator+=(const Fraction &a) { lint np = p * a.q + q * a.p; lint nq = q * a.q; *this = Fraction(np, nq); return *this; } Fraction &operator-=(const Fraction &a) { lint np = p * a.q - q * a.p; lint nq = q * a.q; *this = Fraction(np, nq); return *this; } Fraction &operator*=(const Fraction &a) { lint np = p * a.p; lint nq = q * a.q; *this = Fraction(np, nq); return *this; } Fraction &operator/=(const Fraction &a) { assert(a.p != 0); lint np = p * a.q; lint nq = q * a.p; *this = Fraction(np, nq); return *this; } Fraction operator+(const Fraction &a) { return Fraction(*this) += a; } Fraction operator-(const Fraction &a) { return Fraction(*this) -= a; } Fraction operator*(const Fraction &a) { return Fraction(*this) *= a; } Fraction operator/(const Fraction &a) { return Fraction(*this) /= a; } Fraction operator-() { p = -p; return *this; } bool operator==(const Fraction &a) const { return comp(p, q, a.p, a.q) == 0; } bool operator!=(const Fraction &a) const { return comp(p, q, a.p, a.q) != 0; } bool operator<(const Fraction &a) const { return comp(p, q, a.p, a.q) == -1; } bool operator>(const Fraction &a) const { return comp(p, q, a.p, a.q) == 1; } bool operator<=(const Fraction &a) const { return comp(p, q, a.p, a.q) <= 0; } bool operator>=(const Fraction &a) const { return comp(p, q, a.p, a.q) >= 0; } friend ostream &operator<<(ostream &os, Fraction a) { return os << a.p << "/" << a.q; } }; int main() { int a, b; cin >> a >> b; if (a >= 12) { a -= 12; } Fraction sht(1, 120), lng(1, 10); sht *= Fraction((a * 60 + b) * 60); lng *= Fraction(b * 60); Fraction d = sht - lng; if (d < Fraction(0)) { d += Fraction(360); } Fraction ans = d / Fraction(11, 120); cout << ans.p / ans.q << endl; }