#include using namespace std; #define For(i, a, n) for(int i =a;i pii; template void dbg(Args&&... args){ ((cerr< pair operator+(const pair&a, const pair& b){ return {a.first +b.first, a.second + b.second}; } template ostream& operator<< (ostream& os, const pair& a){ return os<<"("< basic_ostream& operator<<(basic_ostream& os, const C&c){ for(auto it=begin(c); it!=end(c);++it){ os<<(it==begin(c)?"":" ")<<*it; } return os; } void solve(){ int n, m;cin>>n>>m; ll sum = 0; ll male = 123124312312; For(i, 0, n){ For(j, 0, m){ ll a;cin>>a; sum += a; if((i+j)%2==1){ male =min(male, a); } } } dbg(male); if(n%1||m%1)cout<sync_with_stdio(0); cin.exceptions(cin.failbit); int t=1;//cin>>t; while(t--){ solve(); } }