#P7819. [RC-05] Xor Matrix
[RC-05] Xor Matrix
Description
You are given an matrix. The value in row and column is .
For each query, compute the base- xor sum of the submatrix with top-left corner and bottom-right corner (that is, addition without carry. For example, in base , ).
Input Format
To reduce the number of test points, this problem contains multiple queries in a single test. The time limit has been adjusted according to the number of query groups.
The first line contains two positive integers .
The next line contains an integer , the number of queries.
The next lines each contain five positive integers , describing one query.
Output Format
Output lines. Each line contains one integer, the answer to the corresponding query.
15 233
2
1 1 3 3 2
4 8 14 200 24
319
7032
939 943 10
94 618 848 927 92
421 16 525 45 99
77 524 662 779 82
316 630 910 669 51
857 241 890 447 9
44 30 95 409 83
408 302 804 331 73
571 42 761 334 70
419 220 704 855 54
432 80 669 799 52
33786429
97803
41147634
6638925
738
96232
19796958
14611599
6717042
6402992
Hint
This problem uses bundled judging.
For all data, , , , , .
The detailed Constraints are shown in the table below:
| Subtask ID | Special Property | Score | |
|---|---|---|---|
| None | |||
Subtask Dependencies
On Luogu, this problem does not have subtask dependencies. On InfOJ, subtask depends on subtask . During final scoring, the version with subtask dependencies will be used.
Translated by ChatGPT 5
京公网安备 11011102002149号