#include using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) template bool chmax(T &a, const T &b) { if(a bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;} //------------------------------------------------------- ll mo; const int MAT=402; ll A[MAT][MAT]; ll B[MAT][MAT]; ll rev(ll a, ll n = mo-2) { ll r=1; while(n) r=r*((n%2)?a:1)%mo,a=a*a%mo,n>>=1; return r; } int mat_rank(int r,int c,ll ma_[MAT][MAT]) { static ll tmp[MAT][MAT]; int y,x,step; FOR(y,r) FOR(x,c) tmp[y][x]=ma_[y][x]; int ret=0; FOR(step,c) { for(y=ret;y>mo>>H>>W; FOR(y,H) FOR(x,W) { cin>>A[y][x]; B[y][x]=A[y][x]; } int rank=mat_rank(H,W,B); if(rank==0) rank=1; if(H*W<=(H+W)*rank) { cout<<1< V; FOR(x,W) { FOR(y,H) if(B[y][x]) { V.push_back(x); break; } } sort(ALL(V)); V.erase(unique(ALL(V)),V.end()); if(V.size()