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