8488: Copy

内存限制:128 MB 时间限制:2 S
题面:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

Kayzin has a list of integers, initially the list is a1,a2...an. He will execute operations.
For an operation of first type, he will select an interval[li,ri] , copy and insert it to the end of the
interval.
For an operation of second type, he wonder the -th integer of the list.
You need to print the xor sum of all the answers of second type operations.
ps: What is xor? The xor value of two integers is equal to addition in binary without carry.

输入格式

First line is an integer , indicating the number of test cases. For each test case:
First line is 2 integers , indicating the length of initial list and the number of operations.
Next line is integers , indicating the initial list.
Next line, one operation per line. The -th line could be 3 integers ( ), indicating the first type
operation, or 2 integers ( ), indicating the second type operation.
1 ≤ T ≤ 10, 1 ≤ n,q ≤ 10 ,1 ≤ a≤i109 ,∑n ≤  10 5, ∑q ≤ 10 5,1 ≤ xi,li ,ri ≤n
the number of first type operations not exceeds .

输出格式

For each test case, print one line, indicating the xor sum of the answers.

输入样例 复制

1
5 3
1 2 3 4 5
2 4
1 2 4
2 5

输出样例 复制

6