#include <bits/stdc++.h>
using namespace std;
const int maxn = 2020;
int n, k;
long long c[maxn][maxn];
inline void init() {
  c[0][0] = c[1][0] = c[1][1] = 1;
  for (register int i = 2; i <= n; i++) {
    c[i][0] = c[i][i] = 1;
    for (register int j = 1; j < i; j++) {
      c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
    }
  }
}
int mp[maxn][maxn];
long long res[maxn];
long long deg[maxn];
long long cases = 0;
long long ans = 0;
int main() {
  scanf("%d", &n);
  scanf("%d", &k);
  init();
  for (register int i = 1; i <= n; i++) {
    for (register int j = i + 1; j <= n; j++) {
      scanf("%d", &mp[i][j]);
      if (mp[i][j] == -1) continue;
      mp[j][i] = mp[i][j];
      res[i] += mp[i][j];
      res[j] += mp[i][j];
      deg[i]++;
      deg[j]++;
    }
  }
  for (register int i = 1; i <= n; i++) {
    ans += res[i] * c[deg[i]][k] * k / deg[i];
    cases += c[deg[i]][k];
  }
  printf("%lld\n", ans / cases);
  return 0;
}
