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