#include <bits/stdc++.h>
using namespace std;
int const N = 2e3 + 13;
int w[N][N], n, k;
void solve() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) w[i][j] = -1;
  for (int i = 1; i < n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      scanf("%d", &w[i][j]);
      w[j][i] = w[i][j];
    }
  }
  long long ans = 0;
  if (k >= 3) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        if (w[i][j] != -1) ans += w[i][j];
      }
    }
    ans /= n;
  } else {
    if (k == 1) {
      for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
          if (w[i][j] != -1) ans += w[i][j];
      ans /= n;
    } else {
      for (int i = 1; i <= n; ++i) {
        int cnt = 0;
        for (int j = 1; j <= n; ++j)
          if (w[i][j] != -1) ++cnt;
        for (int j = 1; j <= n; ++j)
          if (w[i][j] != -1) {
            ans += (cnt - 1) * 1LL * w[i][j];
          }
      }
      ans /= ((n * (n - 1)) / 2);
    }
  }
  printf("%I64d\n", ans);
}
int main() {
  solve();
  return 0;
}
