#include <bits/stdc++.h>
double C(int n, int k) {
  double ans = 1;
  int i;
  if (k == 0) return 1.0;
  for (i = n - k + 1; i <= n; i++) ans *= i;
  for (i = 1; i <= k; i++) ans /= i;
  return ans;
}
int mat[2006][2006];
long long total[2006];
int main() {
  int n, k, tmp, i, j;
  double ans = 1, sum = 0;
  int edgenum = 0;
  scanf("%d%d", &n, &k);
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n; j++) {
      scanf("%d", &tmp);
      mat[i][j] = tmp;
      mat[j][i] = tmp;
      if (tmp >= 0) sum += tmp;
      if (tmp >= 0) {
        total[i] += tmp;
        total[j] += tmp;
        edgenum++;
      }
    }
  }
  ans = k * (n - k) * sum * 2 / n / (n - 1);
  if (k != 2)
    printf("%I64d\n", (long long)ans);
  else {
    sum = 0;
    for (i = 0; i < n; i++) {
      for (j = i + 1; j < n; j++) {
        if (mat[i][j] != -1) {
          sum += total[i] + total[j] - 2 * mat[i][j];
        }
      }
    }
    ans = sum / C(n, 2);
    printf("%I64d\n", (long long)ans);
  }
  return 0;
}
