func_code_string: #include <bits/stdc++.h>   using namespace std;   int gi() {     int f = 1, x = 0;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = x * 10 + ch -  0 ;       ch = getchar();     }     return f == 1 ? x : -x;   }   const int N = 1005;   int n, m, r, c;   double a[N][N], x[N];   void get_solution() {     for (int i = (1); i <= (m); ++i) {       double r = a[i + 1][i] / a[i][i];       a[i + 1][i] -= r * a[i][i];       a[i + 1][i + 1] -= r * a[i][i + 1];       a[i + 1][m + 1] -= r * a[i][m + 1];     }     for (int i = (m); i >= (1); --i) {       double r = a[i - 1][i] / a[i][i];       a[i - 1][i] = 0;       a[i - 1][m + 1] -= r * a[i][m + 1];       x[i] = a[i][m + 1] / a[i][i];     }   }   int main() {     n = gi(), m = gi(), r = gi(), c = gi();     if (m == 1)       return cout << fixed << setprecision(10) << (n - r) * 2 << endl, 0;     if (r == n) return puts( 0.0000000000 ), 0;     for (int _ = (n - 1); _ >= (1); --_) {       for (int i = (1); i <= (m); ++i) {         if (i == 1) {           a[i][i] = 2. / 3;           a[i][i + 1] = -1. / 3;           a[i][m + 1] = 1. / 3 * x[i] + 1;         } else if (i == m) {           a[i][i] = 2. / 3;           a[i][i - 1] = -1. / 3;           a[i][m + 1] = 1. / 3 * x[i] + 1;         } else {           a[i][i] = 3. / 4;           a[i][i + 1] = -1. / 4;           a[i][i - 1] = -1. / 4;           a[i][m + 1] = 1. / 4 * x[i] + 1;         }       }       get_solution();       if (_ == r) return cout << fixed << setprecision(10) << x[c] << endl, 0;     }     return 0;   }   