A device ID is a distinct number associated with a smartphone or similar handheld device. Every smartphone has a unique device ID.
Now, you have got a job in CodeMask Mobile Company & your task is to set device IDs for new made handsets. You have to select unique device ID for handsets. But the company maintains a rule. You can also recycle some device IDs. That means, if some devices are destroyed, you can use those devices in the future.
So, you have to do three kinds of works:
Now as an employee of CodeMask Mobile Company, you have to do these three tasks.
The input file contains several test cases T (T <= 5).
In every test case, the first line contains a value N (number of tasks to complete, 1 <= N <= 100000).
Then next N lines contains one of the following lines:
(1 <= x <= 1000000000)
For each test case, the first line should be the line with case number as “Case y:” where y is the case number. After that each line contains a number for the 3rd type of task.
1 6 1 3 3 1 1 3 2 1 3
Case 1: 1 2 1
This problem was authored for CodeMask Championship 2016 and is being hosted on Toph per organizer’s request.