#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef double DB; typedef pair PII; typedef vector VI; typedef vector VPII; #define X first #define Y second #define pb push_back #define bit(n) (1 << (n)) #define count(n) (__builtin_popcount(n)) #define countl(n) (__builtin_popcountll(n)) template inline void chkmin(T &x, T y) { if (y < x) x = y; } template inline void chkmax(T &x, T y) { if (x < y) x = y; } const int MN = 505; int n, q, m; int val[MN][MN]; int a[MN][MN]; void add(int x, int y, int v) { for (int xx = x; xx < MN; xx += xx & -xx) { for (int yy = y; yy < MN; yy += yy & -yy) { val[xx][yy] ^= v; } } } int get(int x, int y) { int rlt = 0; for (int xx = x; xx; xx -= xx & -xx) { for (int yy = y; yy; yy -= yy & -yy) { rlt ^= val[xx][yy]; } } return rlt; } int main() { int tn; int tp, x1, y1, x2, y2; for (cin >> tn; tn--; ) { scanf("%d%d%d", &n, &m, &q); memset(val, 0, sizeof val); for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) { scanf("%d", &a[i][j]); add(i, j, a[i][j]); } while (q--) { scanf("%d", &tp); if (tp == 1) { scanf("%d%d%d%d", &x1, &y1, &x2, &y2); int t = get(x2, y2) ^ get(x1 - 1, y2) ^ get(x2, y1 - 1) ^ get(x1 - 1, y1 - 1); if (t) puts("Yes"); else puts("No"); } else { int x, y, v; scanf("%d%d%d", &x, &y, &v); add(x, y, a[x][y]); add(x, y, v); a[x][y] = v; } } } return 0; }