

1 ‘X’: Enqueue element ‘X’ into the end of the nth queue. Returns true if the element is enqueued, otherwise false.
2: Dequeue the element at the front of the nth queue. Returns -1 if the queue is empty, otherwise, returns the dequeued element.
Enqueue means adding an element to the end of the queue, while Dequeue means removing the element from the front of the queue.
The first line of input contains two space-separated integers ‘N’ and ‘Q’ denoting the size of queue and number of queries, respectively.
The next ‘Q’ lines specify the type of operation/query to be performed on the data structure.
Each query contains an integer ‘P’ denoting the type of query.
For query of type 1, the integer ‘P’ is equal to 1 and it is followed by one integer ‘X’ denoting the element on which operation is to be performed.
For query of type 2, the integer ‘P’ is equal to 2 which dequeues the element.
For each query, return the output returned after performing the corresponding operation on the data structure.
Print the output of each test case in a separate line.
You don’t need to print anything. It has already been taken care of. You just have to complete the given functions.
1 <= N <= 1000
1 <= Q <= 10^5
1 <= P <= 2
1 <= X <= 10^5
Time limit: 1 sec
In this approach, we will be implementing a circular queue using arrays. A circular queue has two key methods or purpose: