#include <bits/stdc++.h>
int main() {
  int a, b;
  while (scanf("%d%d", &a, &b) == 2) {
    if (a < b) {
      puts("-1");
    } else {
      double n = (a - b) / (2 * b);
      printf("%.12f\n", b + (a - (2.0 * n + 1.0) * b) / (2.0 * n + 2.0));
    }
  }
  return 0;
}
