#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  long double ans;
  if (n == 1)
    ans = 1;
  else if (m == 1)
    ans = 1 / (long double)n;
  else {
    ans = ((long double)2 * m * n - m - n) / (n * (n * m - 1));
  }
  cout << fixed << setprecision(10) << ans;
}
