#include <bits/stdc++.h>
using namespace std;
void solve(int a) {
  int b;
  cin >> b;
  if (b > a) {
    puts("-1");
    return;
  }
  double num = a + b;
  double denom = 2.0 * ((a + b) / (2 * b));
  double ans = num / denom;
  printf("%.15f\n", ans);
}
int main() {
  int n;
  while (cin >> n) solve(n);
}
