func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1005;   double a[N][N], f[N];   int n, m, sx, sy;   inline void solve(int x) {     memset(a, 0, sizeof(a));     for (int i = 1; i <= m; ++i) {       if (i == 1) {         a[1][1] = 2;         a[1][2] = -1;         a[1][m + 1] = 3 + f[1];       } else if (i == m) {         a[m][m] = 2;         a[m][m - 1] = -1;         a[m][m + 1] = 3 + f[m];       } else {         a[i][i] = 3;         a[i][i - 1] = a[i][i + 1] = -1;         a[i][m + 1] = 4 + f[i];       }     }     for (int i = 1; i < m; ++i) {       double p = a[i + 1][i] / a[i][i];       a[i + 1][i] = 0;       a[i + 1][i + 1] -= a[i][i + 1] * p;       a[i + 1][m + 1] -= a[i][m + 1] * p;     }     f[m] = a[m][m + 1] / a[m][m];     for (int i = m - 1; i >= 1; --i) {       f[i] = (a[i][m + 1] + f[i + 1]) / a[i][i];     }   }   int main() {     scanf( %d%d , &n, &m);     scanf( %d%d , &sx, &sy);     if (m == 1) {       printf( %.10lf n , 2.0 * (n - sx));       return 0;     }     for (int i = n - 1; i >= sx; --i) solve(i);     printf( %.10lf n , f[sy]);     return 0;   }   