#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#define M 5005
using namespace std;

int r,b;
double f[2][M];

int main(){
	scanf("%d%d",&r,&b);
	int tmp=0;
	for(int i=1;i<=r;i++){
		tmp=tmp^1;
		f[tmp][0]=i;
		for(int j=1;j<=b;j++)
			f[tmp][j]=max((double)0,(double)i/(i+j)*(f[tmp^1][j]+1)+(double)j/(i+j)*(f[tmp][j-1]-1));
	}
	long long ans=f[r&1][b]*1000000;
	printf("%f",(double)ans/1000000);
	return 0;
}

 

0 0 votes
文章评分
0 评论
Inline Feedbacks
View all comments