#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, val;
  double ans;
  cin >> a >> b;
  if (b > a) {
    printf("-1\n");
  } else {
    val = (a + b) / (2 * b);
    ans = (a + b) / (2.0 * val);
    printf("%.9lf\n", ans);
  }
  return 0;
}
