#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-5;
bool eq(double a, double b) { return abs(a - b) <= eps; }
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<double> > dp(n, vector<double>(m));
  for (int j = 0; j < m; ++j) {
    dp[n - 1][j] = 0;
  }
  for (int i = n - 2; i >= 0; --i) {
    if (m == 1) {
      dp[i][0] = 2 + dp[i + 1][0];
    } else if (m == 2) {
      dp[i][0] = dp[i][1] = 3 + dp[i + 1][0];
    } else {
      vector<double> a(m), b(m);
      a[1] = 0.5, b[1] = (3 + dp[i + 1][0]) / 2.0;
      for (int j = 1; j < m - 1; ++j) {
        a[j + 1] = 1.0 / (3 - a[j]);
        b[j + 1] = (4 + b[j] + dp[i + 1][j]) / (3 - a[j]);
      }
      vector<double> x(m);
      dp[i][m - 1] = (dp[i + 1][m - 1] + 3 + b[m - 1]) / (2 - a[m - 1]);
      for (int j = m - 2; j >= 0; --j) {
        dp[i][j] = a[j + 1] * dp[i][j + 1] + b[j + 1];
      }
    }
  }
  cout << fixed;
  cout.precision(12);
  int a, b;
  cin >> a >> b;
  --a, --b;
  cout << dp[a][b] << "\n";
}
