#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
inline char get() {
  static char buf[300000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 300000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  register char c = get();
  register long long f = 1, _ = 0;
  while (c > '9' || c < '0') f = (c == '-') ? -1 : 1, c = get();
  while (c <= '9' && c >= '0') _ = (_ << 3) + (_ << 1) + (c ^ 48), c = get();
  return _ * f;
}
long long inv(long long a) {
  return a == 1 ? 1 : (long long)(mod - mod / a) * inv(mod % a) % mod;
}
double C(long long n, long long m) {
  if (m < 0) return 0;
  if (n < m) return 0;
  if (m > n - m) m = n - m;
  long long up = 1, down = 1;
  for (long long i = 0; i < m; i++) {
    up = up * (n - i) % mod;
    down = down * (i + 1) % mod;
  }
  return up * inv(down) % mod;
}
long long n, k, flag;
double a[2005][2005];
signed main() {
  n = read(), k = read();
  for (register long long i = 1; i <= n; i++) {
    a[i][i] = -1;
    for (register long long j = i + 1; j <= n; j++) a[i][j] = a[j][i] = read();
  }
  double ans = 0;
  for (register long long i = 1; i <= n; i++) {
    long long sn = 0;
    long long su = 0;
    for (register long long j = 1; j <= n; j++) {
      if (a[i][j] != -1) {
        sn += 1;
        su += a[i][j];
      }
    }
    if (sn >= k) ans += C(sn - 1, k - 1) * su;
  }
  ans /= C(n, k);
  printf("%lld", (long long)ans);
  return 0;
}
