#include <bits/stdc++.h>
using namespace std;
long long a, b;
int main() {
  cin >> a >> b;
  if (a < b)
    cout << "-1" << endl;
  else
    cout << setprecision(10) << (a + b) / (2.0 * ((a + b) / (2 * b)));
  return 0;
}
