I’m getting correct answer for all testcases
1<=x<=20 in constraints
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Reader in = new Reader();
int t = in.nextInt();
for(int i=0;i<t;i++){
long x=in.nextInt();
long m=x;
while (m>1) {
x*=m-1;
m-=1;
}
System.out.println(x);
}
}