#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> adj[2500];
long long cost[2500][2500];
long long comb[2009][1009];
long long c = 1000000007;
long long combdp(int n, int k) {
  if (k == 0 || n == k) return 1;
  if (comb[n][k] != -1) return comb[n][k];
  if (comb[n][n - k] != -1) return comb[n][n - k];
  if (k == 1 || n - 1 == k) return n;
  return comb[n][k] = ((combdp(n - 1, k - 1) + combdp(n - 1, k)));
}
int main() {
  memset(comb, -1, sizeof(comb));
  scanf("%d %d", &n, &k);
  int e;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      scanf("%d", &e);
      if (e == -1) continue;
      adj[i].push_back(j);
      adj[j].push_back(i);
      cost[i][j] = e;
      cost[j][i] = e;
    }
  }
  long long sum = 0;
  long long ksum = 0;
  int u, v;
  for (int i = 0; i < n; i++) {
    u = i;
    for (int j = 0; j < adj[i].size(); j++) {
      v = adj[i][j];
      sum = sum + combdp(adj[i].size() - 1, k - 1) * cost[u][v];
    }
    ksum = ksum + combdp(adj[i].size(), k);
  }
  cout << sum / ksum << endl;
}
