#include <bits/stdc++.h>
using namespace std;
const int maxn = 2111;
long long n, k, sum[maxn], deg[maxn], mp[maxn][maxn];
long long C(long long a, long long b) {
  long long res = 1;
  for (int i = a; i >= 1; i--) {
    if (i <= a) res *= i;
    if (i <= b) res /= i;
    if (i <= a - b) res /= i;
  }
  return res;
}
int main() {
  scanf("%lld%lld", &n, &k);
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      long long tmp;
      scanf("%lld", &tmp);
      mp[i][j] = tmp;
      if (tmp != -1) {
        deg[i]++;
        deg[j]++;
        sum[i] += tmp;
        sum[j] += tmp;
      }
    }
  }
  long long ans = 0, cnt = 0;
  for (int i = 1; i <= n; i++) {
    long long tmp = C(deg[i], k);
    cnt += tmp;
    ans += sum[i] * tmp * k / deg[i];
  }
  printf("%lld\n", ans / cnt);
  return 0;
}
