#include <bits/stdc++.h>
using namespace std;
long long K, N, a[2010][2010];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> K;
  long long i, j;
  for (i = 1; i <= N; i++) {
    a[i][i] = -1;
    for (j = i + 1; j <= N; j++) {
      cin >> a[i][j];
      a[j][i] = a[i][j];
    }
  }
  long double sum = 0;
  long long cnt = 0;
  long double res = 0;
  for (i = 1; i <= N; i++) {
    sum = 0, cnt = 0;
    for (j = 1; j <= N; j++)
      if (a[i][j] != -1) sum += a[i][j], cnt++;
    if (cnt < K) continue;
    sum *= K;
    for (j = 0; j < K - 1; j++) {
      sum *= (1.0 * cnt - 1 - j) / (N - j);
    }
    sum /= (N - K + 1);
    res += sum;
  }
  long long ans = (res + 0.0000001);
  cout << ans << "\n";
  return 0;
}
