#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b;
  cin >> a >> b;
  if (b > a) return cout << -1, 0;
  double x = (a + b) / (2.0 * ((a + b) / (2 * b)));
  cout << fixed << setprecision(12) << x;
}
