Nzec in cleanning up problem even getting correct answer in ide

import java.util.ArrayList;
import java.util.Scanner;

public class Main {

public static void main(String[] args)
{
    Scanner sc=new Scanner(System.in);
    int t=sc.nextInt();

    for(int test=0;test<t;t++)
    {
        int n=sc.nextInt();
        int m=sc.nextInt();

        ArrayList<Integer> totalJobs=new ArrayList<>();

        for(int i=1;i<=n;i++)
        {
            totalJobs.add(i);
        }

        for(int j=0;j<m;j++)
        {
            totalJobs.remove(Integer.valueOf(sc.nextInt()));

        }
        int njob=totalJobs.size();




        for(int k=0,temp=0;2*k<njob;k++)
        {
            temp=2*k;

            System.out.print(totalJobs.get(temp)+" ");
        }
            System.out.println();

        for(int j=0,temp=0;2*j+1<njob;j++)
        {
            temp=2*j+1;

            System.out.print(totalJobs.get(temp)+" ");
        }

    }






}

}