Help me in solving PERMOR problem

My issue

explain the logic

My code

import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
      Scanner s=new Scanner(System.in);
      int t=s.nextInt();
    //  long a[]=new long[n];
      while(t-->0)
      {
          int n=s.nextInt();
          
          for(int i=1;i<=n;i++)
          {
                long a[]=new long[n];
                a[i]=s.nextLong();
             System.out.printf("%d ",a[i]);
          }

      }
	}
}

Problem Link: OR Permutation Practice Coding Problem - CodeChef

@harikrishna029
here refer my c++ code for better understanding

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    int n;
	    cin>>n;
	    for(int i=n;i>=1;i--)
	    cout<<i<<" ";
	    cout<<endl;
	}
	return 0;
}