#include <bits/stdc++.h>
char ch;
inline void read(int &x) {
  x = 0;
  ch = getchar();
  while (ch <= 32) ch = getchar();
  int f = 1;
  if (ch == '-') f = -1, ch = getchar();
  while (ch > 32) x = x * 10 + ch - 48, ch = getchar();
  x *= f;
}
int n, k;
int a[2005][2005];
int main() {
  read(n);
  read(k);
  int i, j;
  for (i = 1; i < n; i++) {
    for (j = i + 1; j <= n; j++) {
      int x;
      read(x);
      a[i][j] = a[j][i] = x;
    }
  }
  for (i = 1; i <= n; i++) a[i][i] = -1;
  long long sum = 0;
  int cnt;
  if (k == 1 || k == n - 1) {
    cnt = n;
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++)
        if (a[i][j] != -1) sum += a[i][j];
    }
  } else {
    cnt = n * (n - 1) / 2;
    for (i = 1; i <= n; i++) {
      int d = 0;
      long long tmp = 0;
      for (j = 1; j <= n; j++)
        if (a[i][j] != -1) ++d, tmp += a[i][j];
      sum += 1LL * (d - 1) * tmp;
    }
  }
  printf("%I64d\n", sum / cnt);
}
