#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  double x, y;
  cin >> x >> y;
  if (x < y) return cout << -1, 0;
  cout << fixed << setprecision(10)
       << (x + y) / (2 * ((int)((x + y) / (2 * y))));
  return 0;
}
