#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  int k, q, f = 0;
  double p;
  scanf("%d", &a), scanf("%d", &b);
  if (b + a > 0) {
    c = b + a;
    q = c / (2 * (b));
    if (q >= 1) {
      f = 1;
      p = (double)c / (double)(2 * q);
    }
  }
  if (b - a <= 0) {
    c = a - b;
    q = c / (2 * b);
    if (q >= 1 && !f) {
      f = 1;
      p = (double)c / (double)(2 * q);
    }
  }
  if (f == 0)
    printf("-1\n");
  else
    cout << setprecision(11) << p << endl;
  return 0;
}
