#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long a, b;
  double p, q, r, s;
  cin >> a >> b;
  if (a < b)
    cout << "-1";
  else if (a >= b) {
    r = a, s = b;
    cout << setprecision(20) << ((r + s) / (2 * floor(((r + s) / (2 * s)))));
  }
  return 0;
}
