#include <bits/stdc++.h>
int n, k, map[2001][2001], sum[2001];
long double c[2001][2001];
void init() {
  for (int i = 1; i <= 2000; i++) {
    c[i][0] = 1;
    c[i][i] = 1;
  }
  for (int i = 2; i <= 2000; i++)
    for (int j = 1; j < i; j++) c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
}
int main() {
  init();
  while (scanf("%d%d", &n, &k) != EOF) {
    memset(sum, 0, sizeof(sum));
    int ss = 0;
    for (int i = 1; i <= n; i++) {
      map[i][i] = -1;
      for (int j = i + 1; j <= n; j++) {
        scanf("%d", &map[i][j]);
        map[j][i] = map[i][j];
        if (map[i][j] != -1) {
          sum[i]++;
          sum[j]++;
        }
      }
      ss += c[sum[i]][k];
    }
    double ans = 0;
    for (int i = 1; i <= n; i++) {
      double ans1 = 0;
      for (int j = 1; j <= n; j++) {
        if (map[i][j] != -1) {
          ans1 += map[i][j] / ((double)sum[i]) * k;
        }
      }
      ans += ans1 * (c[sum[i]][k] / ss);
    }
    printf("%I64d\n", (long long)(ans));
  }
}
