#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 1e5 + 10;
map<long long, long long> ml;
void addWeight(long long x, long long w) { ml[x] += w; }
long long getWeight(long long x) {
  if (ml.count(x))
    return ml[x];
  else
    return 0;
}
int main() {
  long long a, b;
  cin >> a >> b;
  a + b;
  if (a < b) {
    cout << -1 << endl;
  } else {
    long long sum = a + b;
    printf("%.15f\n", sum / (2.0 * (sum / (2 * b))));
  }
  return 0;
}
