#include <bits/stdc++.h>
using namespace std;
const int Max = 1000 + 5;
int main() {
  int x, y;
  cin >> x >> y;
  if (y > x) {
    printf("-1\n");
    return 0;
  }
  x += y;
  int tmp = x / (y * 2);
  printf("%.10f\n", (double)x / tmp / 2);
  return 0;
}
