There is a polyline going through points (0, 0) – (*x*, *x*) – (2*x*, 0) – (3*x*, *x*) – (4*x*, 0) – ... - (2*kx*, 0) – (2*kx* + *x*, *x*) – .... 

We know that the polyline passes through the point (*a*, *b*). Find minimum positive value *x* such that it is true or determine that there is no such *x*.
Only one line containing two positive integers *a* and *b* (1 ≤ *a*, *b* ≤ 10<sup class="upper-index">9</sup>).
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<queue>
#include<map>
#include<bitset>
using namespace std;
#define PII pair<int,int>
#define X first
#define Y second
#define PB push_back
#define CLR(a) memset(a, 0, sizeof(a))
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FOE(i,a,b) for (int i=(a);i<=(b);i++)
#define FIT(i,a) for (__typeof__((a).begin()) i = (a).begin(); i != (a).end(); i++)
#define TRA(i,a,b) for (int i = (a); i != -1; i = (b)[i])
#define INF (1 << 30)
#define EPS (1e-9)
#define REP(i,n) FOR(i,0,n)
#define LL long long
#define MOD 1000000000

int n, m, a, b;
int main(){
        scanf("%d%d", &a, &b);
        if (b > a) puts("-1");
        else if (a == b) printf("%d\n", a);
        else{
                LL kx = a + b;
                LL lo = 1, hi = MOD, mid;
                while(lo <= hi){
                        mid = (lo + hi) / 2;
                        if (kx >= 2 * mid * b) lo = mid + 1;
                        else hi = mid - 1;
                }
                printf("%.12f\n", kx / 2.0 / hi);
        }
        return 0;
}
