#include <bits/stdc++.h>
using namespace std;
const double EPS = -1e8;
const double Pi = acos(-1);
bool inline equ(double a, double b) { return fabs(a - b) < EPS; }
int main() {
  int a, b;
  cin >> a >> b;
  int ji = a / b;
  while (ji % 2 == 0) ji--;
  if (ji == -1)
    cout << "-1\n";
  else {
    double x = a, y = b, g = ji;
    double ans = (x + y) / (g + 1);
    printf("%.10f\n", ans);
  }
}
