提交时间:2025-06-08 13:56:27

运行 ID: 37970

#include <bits/stdc++.h> using namespace std; #define ll long long ll h,m,ans; int main() { //freopen("relax.in","r",stdin); //freopen("relax.out","w",stdout); ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> h >> m; ll tot = h * m; if(h <= m) ans = (m + m - h + 1) * h / 2ll; else ans = (m + 1) * m / 2ll; ll s = __gcd(tot,ans); tot /= s; ans /= s; cout << ans << "/" << tot; return 0; }