#include <bits/stdc++.h>
using namespace std;
const int N = 2100;
double ans[N][N];
void tdma(double a[], double b[], double c[], double x[], int len) {
  c[1] = c[1] / b[1];
  x[1] = x[1] / b[1];
  for (int i = 2; i <= len; i++) {
    double m = 1.0 / (b[i] - a[i] * c[i - 1]);
    c[i] = c[i] * m;
    x[i] = (x[i] - a[i] * x[i - 1]) * m;
  }
  for (int i = len; i >= 1; i--) x[i] = x[i] - c[i] * x[i + 1];
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int u, v;
  scanf("%d%d", &u, &v);
  if (m == 1) {
    ans[n][1] = 0;
    for (int i = n - 1; i >= 1; i--) {
      ans[i][1] = ans[i + 1][1] + 2;
    }
    printf("%f\n", ans[u][v]);
    return 0;
  }
  double a[N], b[N], c[N], x[N];
  for (int i = n - 1; i >= 1; i--) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    memset(c, 0, sizeof(c));
    memset(x, 0, sizeof(x));
    for (int j = 2; j < m; j++) {
      a[j] = 1, b[j] = -3, c[j] = 1;
      x[j] = -4 - ans[i + 1][j];
    }
    b[1] = -2, c[1] = 1, b[m] = -2, a[m] = 1;
    x[1] = -3 - ans[i + 1][1], x[m] = -3 - ans[i + 1][m];
    tdma(a, b, c, x, m);
    for (int j = 1; j <= m; j++) ans[i][j] = x[j];
  }
  printf("%f\n", ans[u][v]);
  return 0;
}
