#include <bits/stdc++.h>
using namespace std;
double dp[1100][1100];
int n, m, x, y;
int main() {
  int i, j, T;
  scanf("%d%d%d%d", &n, &m, &x, &y);
  if (m == 1) {
    printf("%d\n", (n - x) * 2);
    return 0;
  }
  for (i = n - 1; i >= x; --i)
    for (T = 1; T <= 60; ++T)
      for (j = 1; j <= m; ++j) {
        if (j == 1)
          dp[i][j] = 1 + (dp[i + 1][j] + dp[i][j] + dp[i][j + 1]) / 3;
        else if (j == m)
          dp[i][j] = 1 + (dp[i + 1][j] + dp[i][j] + dp[i][j - 1]) / 3;
        else
          dp[i][j] =
              1 + (dp[i][j] + dp[i + 1][j] + dp[i][j - 1] + dp[i][j + 1]) / 4;
      }
  printf("%.9lf\n", dp[x][y]);
  return 0;
}
