There is a set with size n initially, and there are q operations, each operation will be one of the following cases:
Add x: add x to this set.
Delete: delete the minimum element of the set.
Query: print the minimum element of the set.
11541154
There is a set with size n initially, and there are q operations, each operation will be one of the following cases:
Add x: add x to this set.
Delete: delete the minimum element of the set.
Query: print the minimum element of the set.
The first line will be an integer T, which is the number of test cases. (1 <= T <= 10).
For each test case, the first line will be an integer n (1 <= n <= 10^5), then the second line will be n integers ai (1<=ai<=10^9), they make up the initial set. The third line will be an integer q (1 <= q <= 10^5), it means the number of operations. Then followed by q lines, each line will be one of the following cases:
1 x: Add x (1<=x<=10^9).
2: Delete.
3: Query.
For each “Query”, print the minimum element of the set in a line.
1
2
2 3
2
1 2
3
2