// // Created by zeronosu77108 on Jan 15, 2021. // #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<ostream &operator<<(ostream &o,const vector&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<> n >> m; vector a(n, vector(n, 0)); for (int i=0; i> a[i][j]; } long comb = (1L<> 1) | y; long d = comb & 3; long r = ((comb)>>2) & ((1<>(n+2)); long sum = 0; vector used(n, vector(n, false)); if (d & 1) { for (int i=0; i>i&1) { for (int j=0; j>i&1) { for (int j=0; j