Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
38010 | LYLAKIOI | 【S】T1 | C++ | Accepted | 100 | 0 MS | 248 KB | 828 | 2025-06-08 16:28:24 |
#include<bits/stdc++.h> #define up(i,l,r) for(int i=(l);i<=(r);++i) #define down(i,l,r) for(int i=(l);i>=(r);--i) #define pi pair<int,int> #define p1 first #define p2 second #define m_p make_pair #define p_b push_back using namespace std; typedef long long ll; inline ll read(){ ll x=0;short t=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')t=-1;ch=getchar();} while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar(); return x*t; } ll gcd(ll a,ll b){return ((!b)?a:gcd(b,a%b));} ll F(ll l,ll r){if(l>r)swap(l,r);return (l+r)*(r-l+1)/2;} void slv(){ int n=read(),m=read(); ll A=F(m,max(m-(n-1),0)),B=n*1ll*m; ll g=gcd(A,B);A/=g,B/=g; printf("%lld/%lld",A,B); } int main(){ //freopen("relax.in","r",stdin),freopen("relax.out","w",stdout); slv(); return 0; }