#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  if (a < b) {
    printf("-1\n");
    return 0;
  }
  int k = (a + b) / (2 * b);
  printf("%.12lf\n", (double)(a + b) / (2 * k));
}
