#include #include #define chmin(x,y) (x) = min((x),(y)) #define chmax(x,y) (x) = max((x),(y)) #define ld long double using namespace std; using namespace atcoder; using ll = long long; const ll mod = 998244353; using mint = modint998244353; using Graph = vector>>; const vector dx = {1,0,-1,0}, dy = {0,1,0,-1}; int main(){ // input int N,K; cin >> N >> K; vector> A(N,vector(N)); for(int i=0;i> A[i][j]; // solve int M = N*K; for(int i=0;i