#include <bits/stdc++.h>
using namespace std;
const long long maxn = 90;
vector<long long> col[2];
long long savecol[maxn];
long long dis[maxn][12];
long long g[88][88];
void solve() {
  long long n, k;
  scanf("%lld %lld", &n, &k);
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= n; j++) scanf("%lld", &g[i][j]);
  long long t = 2000;
  long long ans = LLONG_MAX;
  while ((double)clock() / 1000 < 0.8) {
    col[0].clear();
    col[1].clear();
    for (long long i = 1; i <= n; i++) {
      savecol[i] = rand() % 2;
      col[savecol[i]].push_back(i);
    }
    memset(dis, 0x3f, sizeof(dis));
    dis[1][0] = 0;
    for (long long nowk = 1; nowk <= k; nowk++) {
      for (long long s = 1; s <= n; s++) {
        for (long long d : col[savecol[s] ^ 1]) {
          dis[d][nowk] = min(dis[d][nowk], dis[s][nowk - 1] + g[s][d]);
        }
      }
    }
    ans = min(ans, dis[1][k]);
  }
  cout << ans << endl;
}
signed main() {
  srand(time(NULL));
  solve();
}

### Prompt

Your challenge is to write a cpp solution to the following problem:

Masha lives in a country with n cities numbered from 1 to n. She lives in the city number 1. 

There is a direct train route between each pair of distinct cities i and j, where i ≠ j. In total there are n(n-1) distinct routes. Every route has a cost, cost for route from i to j may be different from the cost of route from j to i.

Masha wants to start her journey in city 1, take exactly k routes from one city to another and as a result return to the city 1. Masha is really careful with money, so she wants the journey to be as cheap as possible. To do so Masha doesn't mind visiting a city multiple times or even taking the same route multiple times.

Masha doesn't want her journey to have odd cycles. Formally, if you can select visited by Masha city v, take odd number of routes used by Masha in her journey and return to the city v, such journey is considered unsuccessful.

Help Masha to find the cheapest (with minimal total cost of all taken routes) successful journey.

Input

First line of input had two integer numbers n,k (2 ≤ n ≤ 80; 2 ≤ k ≤ 10): number of cities in the country and number of routes in Masha's journey. It is guaranteed that k is even.

Next n lines hold route descriptions: j-th number in i-th line represents the cost of route from i to j if i ≠ j, and is 0 otherwise (there are no routes i → i). All route costs are integers from 0 to 10^8.

Output

Output a single integer — total cost of the cheapest Masha's successful journey.

Examples

Input


5 8
0 1 2 2 0
0 0 1 1 2
0 1 0 0 0
2 1 1 0 0
2 0 1 2 0


Output


2


Input


3 2
0 1 1
2 0 1
2 2 0


Output


3

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long maxn = 90;
vector<long long> col[2];
long long savecol[maxn];
long long dis[maxn][12];
long long g[88][88];
void solve() {
  long long n, k;
  scanf("%lld %lld", &n, &k);
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= n; j++) scanf("%lld", &g[i][j]);
  long long t = 2000;
  long long ans = LLONG_MAX;
  while ((double)clock() / 1000 < 0.8) {
    col[0].clear();
    col[1].clear();
    for (long long i = 1; i <= n; i++) {
      savecol[i] = rand() % 2;
      col[savecol[i]].push_back(i);
    }
    memset(dis, 0x3f, sizeof(dis));
    dis[1][0] = 0;
    for (long long nowk = 1; nowk <= k; nowk++) {
      for (long long s = 1; s <= n; s++) {
        for (long long d : col[savecol[s] ^ 1]) {
          dis[d][nowk] = min(dis[d][nowk], dis[s][nowk - 1] + g[s][d]);
        }
      }
    }
    ans = min(ans, dis[1][k]);
  }
  cout << ans << endl;
}
signed main() {
  srand(time(NULL));
  solve();
}

```