For this Question: Given an input stream of n integers, find the kth largest element for each element in the stream.The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. 
Each test case contains two lines. The first line of each test case contains two space-separated integers n and k. Then in the next line are n space-separated values of the array.

Constraints:
1 <= T <= 100
1 <= n <= 10^3
1 <= K <= n
1 <= stream[i] <= 10^5For each test case, in a new line, print the space separated values denoting the kth largest element at each insertion, if the kth largest element at a particular insertion in the stream doesn't exist print -1.Sample Input:
2
6 4
1 2 3 4 5 6
2 1
3 4

Sample Output:
-1 -1 -1 1 2 3
3 4 

Explanation:
Testcase1:
k = 4
For 1, the 4th largest element doesn't exist so we print -1.
For 2, the 4th largest element doesn't exist so we print -1.
For 3, the 4th largest element doesn't exist so we print -1.
For 4, the 4th largest element is 1 {1, 2, 3, 4}
For 5, the 4th largest element is 2 {2, 3, 4 ,5}
for 6, the 4th largest element is 3 {3, 4, 5}, I have written this Solution Code: import java.io.*;

import java.util.*;








class Main {

    public static void main (String[] args) throws IOException {



        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        int t=Integer.parseInt(br.readLine());




        while(t>0){

            String arr[]=br.readLine().split("\\s+");

            int n=Integer.parseInt(arr[0]);

            int k=Integer.parseInt(arr[1]);

            String nums[]=br.readLine().split("\\s+");

            PriorityQueue<Integer> pq = new PriorityQueue<Integer>();

            for(int i=0;i<n;i++){

                int curr=Integer.parseInt(nums[i]);

                if(pq.size()<k){

                    pq.add(curr);

                }

                else{

                    if(curr>pq.peek()){

                        pq.remove();

                        pq.add(curr);

                    }

                }




                if(pq.size()==k){

                    System.out.print(pq.peek()+" ");

                }

                else{

                    System.out.print("-1"+" ");

                }

            }

            t--;

            System.out.println();

        }

    }

}, In this Programming Language: Java, Now tell me if this Code is compilable or not?