#include <bits/stdc++.h>
using namespace std;
long long a, b;
double s, k;
int main() {
  cin >> a >> b;
  if (a < b) {
    cout << -1;
    return 0;
  };
  int k1 = ((a - b) / (2 * b));
  int k2 = ((a + b) / (2 * b));
  double X1 = (b + a) / (2.0 * k2);
  double X2 = (a - b) / (2.0 * k1);
  cout << fixed << setprecision(9) << min(X1, X2);
  return 0;
}
