#include <bits/stdc++.h>
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return ((a * b) / gcd(a, b)); }
using namespace std;
int main() {
  int c, i, j, k, tc, t;
  long long a, b, n, m, cnt = 0;
  cin >> a >> b;
  if (b > a)
    printf("-1");
  else {
    printf("%.12f\n", (a + b) / (2. * ((a + b) / (2 * b))));
  }
  return 0;
}
