#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
int m, n;
while(scanf("%d %d", &m, &n) == 2){
double tot = 0.0;
for(int i = 1; i <=m; i++){
double pos = ((double)i/m)*(m + n);
tot += fabsf(pos - floor(pos + 0.5))/(m+n);
}
printf("%.4lf\n", tot*10000);
}
return 0;
}
uva 3708
最新推荐文章于 2017-08-07 14:46:02 发布