记录一个菜逼的成长。。
找规律推导
ans = n*(m-1)/m^2;
#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <deque>
#include <cctype>
#include <bitset>
#include <cmath>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define cl(a) memset(a,0,sizeof(a))
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
const int INF = 0x3f3f3f3f;
int main()
{
LL n,m;
while(~scanf("%lld%lld",&n,&m)){
if(!n && !m)break;
LL x = n * ( m - 1 );
LL y = m * m;
LL gcd = __gcd(x,y);
printf("%lld/%lld\n",x/gcd,y/gcd);
}
return 0;
}