#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx")
using namespace std;
const long long maxn = 2000 + 20;
const long long inf = (long long)2e9;
const long double pi = asin(1) * 2;
const long double eps = 1e-8;
const long long mod = (long long)1e9 + 7;
const long long ns = 97;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
long double C[maxn][maxn];
vector<pair<long long, long long> > g[maxn];
long double ans = 0;
long double al = 0;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  C[0][0] = 1;
  for (long long i = 0; i < maxn; ++i) {
    C[i][0] = 1;
    for (long long j = 1; j < i; ++j) {
      C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
    }
    C[i][i] = 1;
  }
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; ++i) {
    for (long long j = i + 1; j < n; ++j) {
      long long x;
      cin >> x;
      if (x != -1) {
        g[i].push_back({j, x});
        g[j].push_back({i, x});
      }
    }
  }
  for (long long i = 0; i < n; ++i) {
    long long m = (long long)g[i].size();
    if (m < k) continue;
    long double s = C[m - 1][k - 1];
    al += C[m][k];
    long double res = 0;
    for (auto& u : g[i]) {
      res += u.second;
    }
    res = res * s;
    ans += res;
  }
  ans = ans / al;
  long long r = ans;
  cout << r << '\n';
}
