#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int n, m, sx, sy, Case;
double ans[maxn];
double a[maxn][maxn], f[maxn][maxn];
inline void Gauss() {
  for (int i = 1; i <= m; i++) {
    double x = a[i][i];
    a[i][i] /= x;
    a[i][m + 1] /= x;
    if (i < m) a[i][i + 1] /= x;
    x = a[i + 1][i];
    a[i + 1][i] -= a[i][i] * x;
    a[i + 1][m + 1] -= a[i][m + 1] * x;
    if (i < m) a[i + 1][i + 1] -= a[i][i + 1] * x;
  }
  ans[m] = a[m][m + 1];
  for (int i = m - 1; i; i--) {
    ans[i] = a[i][m + 1];
    if (i > 1) ans[i] -= ans[i - 1] * a[i][i - 1];
    if (i < m) ans[i] -= ans[i + 1] * a[i][i + 1];
  }
}
inline void solve() {
  for (int i = n - 1; i >= sx; i--) {
    a[1][1] = 2.0 / 3, a[1][2] = -1.0 / 3,
    a[1][m + 1] = f[i + 1][1] / 3.0 + 1.0;
    a[m][m - 1] = -1.0 / 3, a[m][m] = 2.0 / 3,
             a[m][m + 1] = f[i + 1][m] / 3.0 + 1.0;
    for (int j = 2; j < m; j++)
      a[j][j - 1] = -1.0 / 4, a[j][j] = 3.0 / 4, a[j][j + 1] = -1.0 / 4,
               a[j][m + 1] = f[i + 1][j] / 4.0 + 1.0;
    Gauss();
    for (int j = 1; j <= m; j++) f[i][j] = ans[j];
  }
}
int main() {
  scanf("%d%d%d%d", &n, &m, &sx, &sy);
  if (m == 1) {
    printf("%lf", 2.0 * (n - sx));
    return 0;
  }
  solve();
  printf("%lf", f[sx][sy]);
  return 0;
}
