#include <bits/stdc++.h>
using namespace std;
int a, b;
int main() {
  scanf("%d%d", &a, &b);
  if (b > a) {
    printf("-1");
    return 0;
  }
  double t = (a + b) / (2 * b);
  printf("%.9f", (double)(a + b) / t / 2);
  return 0;
}
