#include <bits/stdc++.h>
using namespace std;
int a, b;
double ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> a >> b;
  if (b > a) {
    cout << "-1\n";
    return 0;
  }
  ans = (a + b) / (2.0 * ((a + b) / (2 * b)));
  printf("%.12f\n", ans);
  return 0;
}
