#include using namespace std; #define int long long signed main(){ int N,M; cin>>N>>M; vector> D(N,vector(M)); for(int i=0;i>D[i][j]; sort(D[i].begin(),D[i].end()); } int l = -1, r = 2e9; while(r-l > 1){ int lim = (l+r)/2; bool ok = false; vector> dp(N,vector(M,false)); for(int i=0;i 0); } } for(int i=0;i