#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-11;
const int maxn = 1e3 + 10;
int n, m, x, y;
double dp[maxn][maxn];
double a[maxn][maxn], b[maxn];
int main() {
  scanf("%d%d", &n, &m);
  memset(dp, 0, sizeof dp);
  scanf("%d%d", &x, &y);
  for (int i = n - 1; i >= 1; i--) {
    for (int j = 2; j < m; j++) {
      a[j][j] = -3.0 / 4;
      a[j][j - 1] = 1.0 / 4;
      a[j][j + 1] = 1.0 / 4;
      b[j] = -1 - dp[i + 1][j] / 4;
    }
    if (m >= 2) {
      a[m][m] = a[1][1] = -2.0 / 3, a[1][2] = a[m][m - 1] = 1.0 / 3;
      b[1] = -1 - dp[i + 1][1] / 3;
      b[m] = -1 - dp[i + 1][m] / 3;
    } else {
      a[m][m] = a[1][1] = -1.0 / 2;
      b[1] = -1 - dp[i + 1][1] / 2;
      b[m] = -1 - dp[i + 1][m] / 2;
    }
    for (int j = 1; j < m; j++) {
      if (fabs(a[j + 1][j]) < eps) continue;
      double rate = a[j + 1][j] / a[j][j];
      for (int k = 0; k < 2; k++) a[j + 1][j + k] -= a[j][j + k] * rate;
      b[j + 1] -= b[j] * rate;
    }
    for (int j = m; j > 1; j--) {
      if (fabs(a[j - 1][j]) < eps) continue;
      double rate = a[j - 1][j] / a[j][j];
      a[j - 1][j] -= a[j][j] * rate;
      b[j - 1] -= b[j] * rate;
    }
    for (int j = 1; j <= m; j++) dp[i][j] = b[j] / a[j][j];
  }
  printf("%.10lf\n", dp[x][y]);
  return 0;
}
