Problem: You are given a permutation of n numbers p1, p2, ..., pn. We perform k operations of the following type: choose uniformly at random two indices l and r (l ≤ r) and reverse the order of the elements pl, pl + 1, ..., pr. Your task is to find the expected value of the number of inversions in the resulting permutation.

Input

The first line of input contains two integers n and k (1 ≤ n ≤ 100, 1 ≤ k ≤ 109). The next line contains n integers p1, p2, ..., pn — the given permutation. All pi are different and in range from 1 to n.

The problem consists of three subproblems. The subproblems have different constraints on the input. You will get some score for the correct submission of the subproblem. The description of the subproblems follows.

  * In subproblem G1 (3 points), the constraints 1 ≤ n ≤ 6, 1 ≤ k ≤ 4 will hold. 
  * In subproblem G2 (5 points), the constraints 1 ≤ n ≤ 30, 1 ≤ k ≤ 200 will hold. 
  * In subproblem G3 (16 points), the constraints 1 ≤ n ≤ 100, 1 ≤ k ≤ 109 will hold. 

Output

Output the answer with absolute or relative error no more than 1e - 9.

Examples

Input

3 1
1 2 3


Output

0.833333333333333


Input

3 4
1 3 2


Output

1.458333333333334

Note

Consider the first sample test. We will randomly pick an interval of the permutation (1, 2, 3) (which has no inversions) and reverse the order of its elements. With probability <image>, the interval will consist of a single element and the permutation will not be altered. With probability <image> we will inverse the first two elements' order and obtain the permutation (2, 1, 3) which has one inversion. With the same probability we might pick the interval consisting of the last two elements which will lead to the permutation (1, 3, 2) with one inversion. Finally, with probability <image> the randomly picked interval will contain all elements, leading to the permutation (3, 2, 1) with 3 inversions. Hence, the expected number of inversions is equal to <image>.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T>
void remin(T& a, const T& b) {
  if (b < a) a = b;
}
template <typename T>
void remax(T& a, const T& b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline istream& operator>>(istream& s, pair<T1, T2>& p) {
  return s >> p.first >> p.second;
}
template <class T1, class T2>
inline ostream& operator<<(ostream& s, const pair<T1, T2> p) {
  return s << "(" << p.first << " " << p.second << ")";
}
template <class T1>
inline ostream& operator<<(ostream& s, const vector<T1> container) {
  for (typename vector<T1>::const_iterator i = container.begin();
       i != container.end(); i++)
    s << *i << " ";
  return s;
}
template <class T1>
inline istream& operator>>(istream& s, vector<T1>& container) {
  for (typename vector<T1>::iterator i = container.begin();
       i != container.end(); i++)
    s >> *i;
  return s;
}
template <class T>
inline T euclide(T a, T b, T& x, T& y) {
  if (a < 0) {
    T d = euclide(-a, b, x, y);
    x = -x;
    return d;
  }
  if (b < 0) {
    T d = euclide(a, -b, x, y);
    y = -y;
    return d;
  }
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  } else {
    T d = euclide(b, a % b, x, y);
    T t = x;
    x = y;
    y = t - (a / b) * y;
    return d;
  }
}
template <class T>
inline vector<pair<T, int>> factorize(T n) {
  vector<pair<T, int>> R;
  for (T i = 2; n > 1;) {
    if (n % i == 0) {
      int C = 0;
      for (; n % i == 0; C++, n /= i)
        ;
      R.push_back(make_pair(i, C));
    }
    i++;
    if (i > n / i) i = n;
  }
  if (n > 1) R.push_back(make_pair(n, 1));
  return R;
}
template <class T>
inline bool isPrimeNumber(T n) {
  if (n <= 1) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
vector<int> gen_primes(int limit) {
  int sqr_lim;
  int x2, y2;
  int n;
  vector<bool> is_prime(limit + 1, false);
  sqr_lim = (int)sqrt((long double)limit);
  is_prime[2] = true;
  is_prime[3] = true;
  x2 = 0;
  for (int i = 1; i <= sqr_lim; i++) {
    x2 += 2 * i - 1;
    y2 = 0;
    for (int j = 1; j <= sqr_lim; j++) {
      y2 += 2 * j - 1;
      n = 4 * x2 + y2;
      if ((n <= limit) && (n % 12 == 1 || n % 12 == 5))
        is_prime[n] = !is_prime[n];
      n -= x2;
      if ((n <= limit) && (n % 12 == 7)) is_prime[n] = !is_prime[n];
      n -= 2 * y2;
      if ((i > j) && (n <= limit) && (n % 12 == 11)) is_prime[n] = !is_prime[n];
    }
  }
  for (int i = 5; i <= sqr_lim; i++) {
    if (is_prime[i]) {
      n = i * i;
      for (int j = n; j <= limit; j += n) {
        is_prime[j] = false;
      }
    }
  }
  int primes_count = 0;
  for (int i = 2; i < limit; i++) primes_count += is_prime[i];
  vector<int> primes;
  primes.reserve(primes_count);
  for (int i = 2; i < limit; i++)
    if (is_prime[i]) primes.push_back(i);
  return primes;
}
template <class T>
string toString(T n) {
  ostringstream ost;
  ost << n;
  ost.flush();
  return ost.str();
}
int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
long long int toInt64(string s) {
  long long int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
double toDouble(string s) {
  double r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
size_t n, k;
size_t inv_result(size_t l, size_t r, size_t i) {
  if (i > r || i < l) {
    return i;
  }
  return l + r - i;
}
using matrix = vector<vector<double>>;
matrix operator*(const matrix& a, const matrix& b) {
  matrix c(a.size(), vector<double>(a.size(), 0));
  for (size_t i = 0; i < a.size(); ++i) {
    for (size_t k = 0; k < a.size(); ++k) {
      for (size_t j = 0; j < a.size(); ++j) {
        c[i][j] += a[i][k] * b[k][j];
      }
    }
  }
  return c;
}
matrix pow(const matrix& a, size_t n) {
  if (n == 1) {
    return a;
  }
  if (n == 2) {
    return a * a;
  }
  matrix c = pow(a, n / 2);
  c = c * c;
  if (n % 2) {
    c = c * a;
  }
  return c;
}
int main(void) {
  cin >> n >> k;
  vector<vector<double>> matrix(n * (n - 1), vector<double>(n * (n - 1), 0.0));
  vector<pair<int, int>> numeration;
  map<pair<int, int>, size_t> bnumeration;
  for (size_t i0 = 0; i0 < n; ++i0) {
    for (size_t j0 = 0; j0 < n; ++j0) {
      if (i0 != j0) {
        bnumeration[pair<int, int>(i0, j0)] = numeration.size();
        numeration.emplace_back(i0, j0);
      }
    }
  }
  for (size_t num = 0; num < numeration.size(); ++num) {
    for (size_t l = 0; l < n; ++l) {
      for (size_t r = l; r < n; ++r) {
        matrix[num][bnumeration[pair<int, int>(
            inv_result(l, r, numeration[num].first),
            inv_result(l, r, numeration[num].second))]] += 2. / n / (n + 1);
      }
    }
  }
  matrix = pow(matrix, k);
  vector<size_t> perm(n);
  cin >> perm;
  double E = 0;
  for (size_t i = 0; i < numeration.size(); ++i) {
    for (size_t j = 0; j < numeration.size(); ++j) {
      if ((numeration[j].first < numeration[j].second) &&
          (perm[numeration[i].first] > perm[numeration[i].second])) {
        E += matrix[i][j];
      }
    }
  }
  cout.precision(15);
  cout << E << endl;
  return 0;
}