#include <bits/stdc++.h>
using namespace std;
int a[2005][2005], fac[2005], n, i, j, k, d;
double sum, _, t, ans;
double C(int d) {
  double sum = 1;
  for (int i = 1; i <= n; i++) fac[i] = -1;
  for (int i = 1; i <= d - 1; i++) fac[i]++;
  for (int i = 1; i <= k - 1; i++) fac[i]--;
  for (int i = 1; i <= d - k; i++) fac[i]--;
  for (int i = 1; i <= k; i++) fac[i]++;
  for (int i = 1; i <= n - k; i++) fac[i]++;
  for (int i = 1; i <= n; i++)
    while (fac[i])
      if (fac[i] > 0)
        sum *= i, fac[i]--;
      else
        sum /= i, fac[i]++;
  return sum;
}
int main() {
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n; i++)
    for (j = i + 1; j <= n; j++) scanf("%d", &a[i][j]), a[j][i] = a[i][j];
  for (i = 1; i <= n; i++) {
    d = 0;
    sum = 0;
    for (j = 1; j <= n; j++)
      if (i != j && a[i][j] != -1) d++, sum += a[i][j];
    if (d < k) continue;
    t *= k;
    ans += sum * C(d);
  }
  printf("%I64d\n", (long long)ans);
}
