#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 1000;
int n, m;
double E[maxn + 10][maxn + 10];
int sy, sx;
double A[maxn + 10][maxn + 10];
double X[maxn + 10];
bool in(int x) { return 0 <= x && x < m; }
void guass_elimination() {
  int cur, col;
  for (cur = 0, col = 0; cur < m && col < m; col++, cur++) {
    double tmp = A[cur + 1][col] / A[cur][col];
    A[cur + 1][col + 1] -= A[cur][col + 1] * tmp;
    A[cur + 1][m] -= A[cur][m] * tmp;
  }
  for (int i = cur - 1; i >= 0; i--) {
    X[i] = A[i][m];
    for (int k = i + 2; k > i; k--)
      if (i < m) {
        X[i] -= A[i][k] * X[k];
      }
    X[i] /= A[i][i];
  }
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    scanf("%d%d", &sy, &sx);
    sy--;
    sx--;
    for (int(j) = 0; (j) < (m); (j)++) {
      E[n - 1][j] = 0;
    }
    for (int i = n - 2; i >= sy; i--) {
      for (int(j) = 0; (j) < (m); (j)++) {
        int num = 1;
        for (int tj = j - 1; tj <= j + 1; tj++)
          if (in(tj)) {
            num++;
            A[j][tj] = -1.0;
          }
        A[j][j] = num - 1;
        A[j][m] = num + E[i + 1][j];
      }
      guass_elimination();
      for (int(j) = 0; (j) < (m); (j)++) E[i][j] = X[j];
    }
    printf("%.10f\n", E[sy][sx]);
  }
  return 0;
}
