#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10, INF = 1e9 + 10;
const double eps = 1e-9;
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
int main() {
  int a = read(), b = read();
  if (a < b) {
    puts("-1");
    return 0;
  } else if (a == b) {
    printf("%d ", a);
    return 0;
  }
  double ans = (double)(a + b) / (2.0 * ((a + b) / (2 * b)));
  printf("%.10lf", ans);
  return 0;
}
