//BestCoder 1001 //write by Lone Wolf in 2016.04.22 #pragma comment(linker, "/STACK:102400000,102400000") #include #include #include #include #include #include #include #include #include #include #include #include #include #define PI (acos(-1.0)) #define lowbit(x) (x&(-x)) #define sspeed ios_base::sync_with_stdio(0);cin.tie(0) typedef long long LL; using namespace std; const int MOD=1000000007; const int INF=0x3f3f3f3f; const int N=1010; const int M=1010; const int Mat=110; typedef double Matrix[Mat][Mat]; const double eps=1e-10; inline int readint() { char c=getchar(); while (c<'0'||c>'9') c=getchar(); int x=0; while ('0'<=c&&c<='9') { x=x*10+c-'0'; c=getchar(); } return x; } int buf[10]; inline void writeint(int i) { int p=0; if (i==0) p++; else while (i) { buf[p++]=i%10; i/=10; } for (int j=p-1;j>=0;j--) putchar('0'+buf[j]); } int n,m,q; LL A[N][M],B[N][M],DN[N],DM[M]; int LN[N],LM[N]; void solve() { int i,j,k; int x,y,z; scanf("%d%d%d",&n,&m,&q); for (i=1;i<=n;i++) for (j=1;j<=m;j++) scanf("%I64d",&A[i][j]); for (i=1;i<=n;i++) { DN[i]=0; LN[i]=i; } for (i=1;i<=m;i++) { DM[i]=0; LM[i]=i; } for (i=0;i