//n个黑球,m个白球,第i个数为白球si = 0,为黑球si = 1;
//求这个串s中出现01的期望
//期望是可以加的
//那么对于第i个位置出现0第i+1出现1的概率为(n/(n+m))*(m/(n+m-1))
//那么期望为n*m/(n+m-1)
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std ;
int gcd(int a , int b)
{
if(b == 0)
return a ;
return gcd(b , a%b) ;
}
int main()
{
int n , m ;
while(~scanf("%d%d" , &n , &m))
{
int c = gcd(n*m , n+m) ;
printf("%d/%d\n" , n*m/c , (n+m)/c) ;
}
return 0 ;
}
时间: 2024-08-01 22:27:01