#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, b;
  cin >> a >> b;
  double mx = a + b;
  int cnt = mx / (2 * b);
  double raz = mx - cnt * 2 * b;
  if (cnt == 0) {
    cout << -1;
  } else {
    double ans = b + raz / (2 * cnt * 1.0);
    cout << fixed << setprecision(9) << ans;
  }
}
