


The first line of the input contains ‘T’ denoting the number of test cases.
The first line of each test case contains an integer N.
For each test case return the number of satisfying permutations in a new line.
You do not need to print anything or take input. This already has been taken care of. Just implement the function.
1 <= T <= 10
0 <= N <= 15
Time Limit: 1 sec
The idea behind this approach is to construct permutations recursively while satisfying the divisibility criteria for each index as we build it.
We create a boolean array so that we can keep track of what’s already in the array.
We use backtracking to maintain this boolean array.
Algorithm: