#include <bits/stdc++.h>
using namespace std;
int n, m, si, sj;
double dp[1005][1005];
int main() {
  cin >> n >> m >> si >> sj;
  for (int i = n - 1; i >= si; --i)
    for (int _ = 50; _--;)
      for (int j = 1; j <= m; j++)
        dp[i][j] = (dp[i][j] + dp[i + 1][j] + dp[i][j - 1] + dp[i][j + 1]) /
                       (2 + (j != 1) + (j != m)) +
                   1;
  cout << fixed << setprecision(6) << dp[si][sj] << endl;
  return 0;
}
