#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1100;
int n, m, h, w;
double a[MAXN], b[MAXN], c[MAXN], d[MAXN], x[MAXN], dp[MAXN][MAXN];
void TDMA(int l, int n, int m) {
  for (int i = 1; i < n; i++) c[i] = c[i] / (b[i] - c[i - 1] * a[i]);
  for (int i = 1; i <= n; i++)
    d[i] = (d[i] - d[i - 1] * a[i]) / (b[i] - c[i - 1] * a[i]);
  dp[l][n] = d[n];
  for (int i = n - 1; i >= 1; i--) dp[l][i] = d[i] - c[i] * dp[l][i + 1];
}
int main() {
  scanf("%d%d%d%d", &n, &m, &h, &w);
  if (m == 1) {
    printf("%.8f", (double)(n - h) * 2.0);
    return 0;
  }
  for (int i = n - 1; i >= h; i--) {
    b[1] = 2.0 / 3;
    c[1] = -1.0 / 3;
    d[1] = 1 + dp[i + 1][1] / 3;
    if (m > 1) {
      b[m] = 2.0 / 3;
      a[m] = -1.0 / 3;
      d[m] = 1 + dp[i + 1][m] / 3;
    }
    for (int j = 2; j < m; j++) {
      a[j] = c[j] = -1.0 / 4;
      b[j] = 3.0 / 4;
      d[j] = 1 + dp[i + 1][j] / 4;
    }
    TDMA(i, m, m);
  }
  printf("%.8f", dp[h][w]);
  return 0;
}
