#include <bits/stdc++.h>
int n, k, v[2009][2009];
long double C[2009][2009];
int main() {
  scanf("%d%d", &n, &k);
  long double ans = 0;
  C[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    C[i][0] = 1;
    for (int j = 1; j <= k; ++j) C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
  }
  for (int i = 1; i <= n; ++i)
    for (int x, j = i + 1; j <= n; ++j) {
      scanf("%d", &x);
      if (x != -1) v[i][++v[i][0]] = x, v[j][++v[j][0]] = x;
    }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= v[i][0]; ++j) ans += C[v[i][0] - 1][k - 1] * v[i][j];
  printf("%I64d\n", (long long)(ans / C[n][k]));
}
