#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define all(x) (x).begin(), (x).end() #define bit(x) (1 << (x)) #define cnt1(x) (__builtin_popcount(x)) #define LB lower_bound #define LET(it,v) __typeof(v) it(v) #define mset0(x) memset((x), 0, sizeof((x))) #define mset1(x) memset((x), -1, sizeof((x))) #define pb push_back #define PQ priority_queue #define REP(it,v) for(LET(it,v.begin());it!=v.end();it++) #define sqr(x) ((x)*(x)) #define sz(x) ((int)(x.size())) #define UB upper_bound #define X first #define Y second typedef long long LL; typedef double DB; typedef pair pii; typedef pair pll; typedef vector vi; typedef vector vpii; template inline void chkmin(T &a, T b) { if (b < a) a = b; } template inline void chkmax(T &a, T b) { if (a < b) a = b; } const int MX = 505; int val[MX][MX]; int a[MX][MX]; int n, m; void add(int x, int y, int c) { for (; x <= n; x += x & -x) { for (int yy = y; yy <= m; yy += yy & -yy) val[x][yy] ^= c; } } int get(int x, int y) { int rlt = 0; for (; x; x -= x & -x) { for (int yy = y; yy; yy -= yy & -yy) { rlt ^= val[x][yy]; } } return rlt; } int main() { int T, Q; int i, j, v, x1, y1, x2, y2; for (scanf("%d", &T); T--; ) { scanf("%d%d%d", &n, &m, &Q); for (i = 1; i <= n; i++) { for (j = 1; j <= m; j++) val[i][j] = 0; } for (i = 1; i <= n; i++) { for (j = 1; j <= m; j++) { scanf("%d", &v); a[i][j] = v; add(i, j, v); } } int t; while (Q--) { scanf("%d", &t); if (t == 1) { scanf("%d%d%d%d", &x1, &y1, &x2, &y2); int rlt = get(x2, y2) ^ get(x1 - 1, y2) ^ get(x2, y1 - 1) ^ get(x1 - 1, y1 - 1); if (rlt) puts("Yes"); else puts("No"); } else { scanf("%d%d%d", &x1, &y1, &v); add(x1, y1, a[x1][y1]); a[x1][y1] = v; add(x1, y1, a[x1][y1]); } } } return 0; }