#include <bits/stdc++.h>
using namespace std;
stack<time_t> time_stack;
void startTimer() { time_stack.push(clock()); }
double stopTimer() {
  double time = clock() - time_stack.top();
  time_stack.pop();
  return time / double(CLOCKS_PER_SEC);
}
bool eq(double a, double b) { return abs(a - b) < double(1e-7); }
int main() {
  startTimer();
  ios::sync_with_stdio(false);
  long long u, v;
  cin >> u >> v;
  if (v > u)
    cout << -1;
  else {
    cout.precision(9);
    cout << fixed << double(u + v) / (2 * ((u + v) / (2 * v)));
  }
  cout << endl;
  return 0;
}
