#include <bits/stdc++.h>
using namespace std;
double solve(int x, int y) {
  int zero = x + y;
  int div = zero / (y * 2);
  return 0.5 * zero / div;
}
int main() {
  int x, y;
  scanf("%d%d", &x, &y);
  if (y > x)
    puts("-1");
  else
    printf("%.15f\n", solve(x, y));
  return 0;
}
