#include <bits/stdc++.h>
using namespace std;
const int maxn = 2100;
int n, m;
long long ans, s;
int Link[maxn];
long long sum[maxn], C[maxn][maxn];
void init() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i < n; ++i)
    for (int j = i + 1; j <= n; ++j) {
      int value;
      scanf("%d", &value);
      if (value != -1) {
        ++Link[i];
        ++Link[j];
        sum[i] += value;
        sum[j] += value;
      }
    }
}
void C_init() {
  for (int i = 1; i <= n; ++i) {
    C[i][1] = i;
    for (int j = 2; j <= i; ++j) C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
  }
}
void solve() {
  for (int i = 1; i <= n; ++i)
    if (Link[i] >= m) {
      ans += C[Link[i]][m] * sum[i] * m / Link[i];
      s += C[Link[i]][m];
    }
}
int main() {
  init();
  C_init();
  solve();
  printf("%I64d\n", ans / s);
  return 0;
}
