All Submissions


There are two types of operations performed on an array(1-based indexing ) .

0 i x - update an index i to value x.
1 i - Tell the maximum from index 1 to i.

The array is initialised by 0 .

Input

First line contains the number of test cases , T . Each test case consists of 2 integers N Q, number of elements of array and the number of operations .
The next Q lines the description of the operations .

Output

The answer to queries .


Sample Input
1
15 9
0 5 3
1 2
1 1
1 3
0 6 7
0 11 8
0 7 9
1 5
1 12

Sample output
0
0
0
3
9

Constraints
N <= Q < 10^5
x >= 0
x is a 32 bit integer .
T <= 20 .



Problem Setter : Akshit Poddar

Languages: AWK,Bash,Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Python3,Ruby,Text

Time Limit: 2 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0