#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  if (b > a)
    printf("-1\n");
  else {
    double ans, a1, a2;
    a1 = (a + b) / (2.0 * ((a + b) / (2 * b)));
    a2 = (a - b) / (2.0 * ((a - b) / (2 * b)));
    printf("%.12lf\n", min(a1, a2));
  }
}
