func_code_string: #include <bits/stdc++.h>   using namespace std;   inline double f(int n) { return n * (n + 1) / 2; }   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     int n, k;     cin >> n >> k;     double P = 1. / f(n);     vector<int> V(n);     for (auto& x : V) cin >> x;     vector<vector<vector<double>>> DP(         k + 1, vector<vector<double>>(n, vector<double>(n, 0)));     for (int i = 0; i < n; i++)       for (int j = i; j < n; j++)         for (int k = i; k <= j; k++)           for (int l = k + 1; l <= j; l++) DP[0][i][j] += V[k] > V[l];     for (int s = 1; s <= k; s++)       for (int l = 0; l < n; l++)         for (int r = l; r < n; r++)           for (int i = 0; i < n; i++)             for (int j = i + 1; j < n; j++)               DP[s][i][j] +=                   (j < l || i > r                        ? DP[s - 1][i][j]                        : (i <= l && r <= j                               ? DP[s - 1][i][j] + f(r - l) - DP[s - 1][l][r] * 2                               : (l <= i && j <= r                                      ? f(j - i) - DP[s - 1][l + r - j][r + l - i]                                      : (i >= l ? DP[s - 1][r + 1][j] + f(r - i) -                                                      DP[s - 1][l][l + r - i] +                                                      DP[s - 1][l][j] -                                                      DP[s - 1][l + r - i + 1][j] -                                                      DP[s - 1][l][r] +                                                      DP[s - 1][l + r - i + 1][r]                                                : DP[s - 1][i][l - 1] + f(j - l) -                                                      DP[s - 1][r + l - j][r] +                                                      DP[s - 1][i][r] -                                                      DP[s - 1][i][r + l - j - 1] -                                                      DP[s - 1][l][r] +                                                      DP[s - 1][l]                                                        [r + l - j - 1])))) *                   P;     cout << setprecision(20) << DP[k][0][n - 1];     return 0;   }   