#include <bits/stdc++.h>
using namespace std;
int n, m, X, Y;
double mat[1000 + 5][1000 + 5];
double dp[1000 + 5][1000 + 5];
void gauss() {
  for (int i = 1; i <= m - 1; i++) {
    double k = mat[i + 1][i] / mat[i][i];
    mat[i + 1][i] -= mat[i][i] * k;
    mat[i + 1][i + 1] -= mat[i][i + 1] * k;
    mat[i + 1][m + 1] -= mat[i][m + 1] * k;
  }
}
void solve(int x) {
  for (int i = 1; i <= m; i++) {
    if (i == 1) {
      mat[1][i] = 2;
      mat[1][i + 1] = -1;
      mat[1][m + 1] = dp[x + 1][i] + 3;
    } else if (i == m) {
      mat[m][i] = 2;
      mat[m][i - 1] = -1;
      mat[m][m + 1] = dp[x + 1][i] + 3;
    } else {
      mat[i][i] = 3;
      mat[i][i - 1] = -1;
      mat[i][i + 1] = -1;
      mat[i][m + 1] = dp[x + 1][i] + 4;
    }
  }
  gauss();
  dp[x][m] = mat[m][m + 1] / mat[m][m];
  for (int i = m - 1; i >= 1; i--)
    dp[x][i] = (mat[i][m + 1] - dp[x][i + 1] * mat[i][i + 1]) / mat[i][i];
}
int main() {
  scanf("%d %d %d %d", &n, &m, &X, &Y);
  if (m == 1) {
    printf("%.10lf\n", 2.0 * (n - X));
    return 0;
  }
  for (int i = n - 1; i >= 1; i--) solve(i);
  printf("%.10lf\n", dp[X][Y]);
}
