#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  double x, y, minx = 999999999;
  int diff = a - b;
  int sum = a + b;
  if (diff < 0) {
    cout << -1 << endl;
    return 0;
  } else {
    printf("%.12f\n", (a + b) / (2. * ((a + b) / (2 * b))));
  }
  return 0;
}
