import sys input = sys.stdin.readline N,K=map(int,input().split()) P=[list(map(int,input().split())) for i in range(N)] DP=[[1<<60]*(1<K: continue DP[k][to]=min(DP[k][to],DP[i][j]+DIS[i][k]) DIS_COME=[1<<60]*(1<