#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
double ans,a;
int x,y;
int main(){
scanf("%d%d",&x,&y);
if(y==x){
printf("%.12lf\n",(double)x);
}
else if(x<y){
printf("-1\n");
}
else{
int tmp=x-y;
ans=9999999999;
double b=(double)tmp/y;
b=(double)b/2;
int k=(int)b;
a=(double)tmp/2/k;
if(a<ans)
ans=a;
tmp=y+x;
b=(double)tmp/y;
b=(double)b/2;
k=(int)b;
a=(double)tmp/2/k;
if(a<ans)
ans=a;
printf("%.12lf\n",ans);
}
return 0;
}
cf#320 Div.2 Problem C A Problem about Polyline
最新推荐文章于 2018-04-16 20:32:23 发布