#include <bits/stdc++.h>
using namespace std;
long long rdtsc() {
  long long tmp;
  asm("rdtsc" : "=A"(tmp));
  return tmp;
}
inline int myrand() { return abs((rand() << 15) ^ rand()); }
inline int rnd(int x) { return myrand() % x; }
const int INF = (int)1e9 + 1;
const long double EPS = 1e-9;
const int maxn = (int)2e3 + 10;
int c[maxn][maxn];
bool solve() {
  int n, k;
  if (scanf("%d%d", &n, &k) < 2) return 0;
  for (int i = 0; i < n; ++i) {
    c[i][i] = -1;
    for (int j = i + 1; j < n; ++j) {
      scanf("%d", &c[i][j]);
      c[j][i] = c[i][j];
    }
  }
  if (k >= 3) {
    assert(n == k + 1);
    long long sum = 0;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j) {
        if (c[i][j] != -1) sum += c[i][j];
      }
    printf(
        "%lld"
        "\n",
        (sum / (k + 1)));
    return 1;
  }
  long long res = 0, rem = 0;
  int todivide = 1;
  for (int i = 0; i < k; ++i) {
    todivide *= n - i;
    todivide /= i + 1;
  }
  for (int i = 0; i < n; ++i) {
    long long sum = 0;
    int deg = 0;
    for (int j = 0; j < n; ++j) {
      if (c[i][j] == -1) continue;
      ++deg;
    }
    if (deg < k) continue;
    long long cur = 1;
    for (int iter = 0; iter < k - 1; ++iter) {
      cur *= deg - 1 - iter;
      cur /= iter + 1;
    }
    for (int j = 0; j < n; ++j) {
      if (c[i][j] == -1) continue;
      res += (cur * c[i][j]) / todivide;
      rem += (cur * c[i][j]) % todivide;
      if (rem >= todivide) rem -= todivide, res += 1;
    }
  }
  printf(
      "%lld"
      "\n",
      res);
  return 1;
}
int main() {
  srand(rdtsc());
  while (1) {
    if (!solve()) break;
  }
  return 0;
}
