An array is called "unique" if it has no consecutive element with same value().
Given a unique array of integer and queries. Each query will contain 2 integer , which updates the value of index to (). After each query, if the array is not unique, delete some elements from to make it unique. Output the maximum size of which is unique.
Input starts with an integer (), denoting the number of test cases. The next line contains two integers N (), q ().
The next line contains space separated integers forming the array .
The next lines will contain a query which is in the form (, ).
For each test case, print the case number in a single line. Then for each query you have to print a line containing the output: the maximum size of which is unique.
Input | Output |
---|---|
2 5 3 1 2 3 4 5 0 2 3 3 2 3 1 1 10 0 4 | Case 1: 4 4 2 Case 2: 1 |
In the case of test case 1: After the first operation , To make it unique, we remove the first element from making . After the second operation, , it is unique, so no delete operation needed. After third operation , the largest unique array . |