100% Guaranteed Results


Project
$ 29.99
Category:

Description

5/5 – (1 vote)

This problem is a programming version of Problem 24 from projecteuler.net
A permutation is an ordered arrangement of objects. For example, dabc is one possible permutation of the word abcd. If all of the permutations are listed alphabetically, we call it lexicographic order. The lexicographic permutations of abc are:
abc acb bac bca cab cba
What is the Nth lexicographic permutation of the word abcdefghijklm?
Input Format
The first line contains an integer T , i.e., number of test cases.
Next T lines will contain an integer N.
Output Format
Print the values corresponding to each test case.
Constraints
1 ≤ T ≤ 1000 1 ≤ N ≤ 13!
Sample Input

Sample Output

Reviews

There are no reviews yet.

Be the first to review “Project”

Your email address will not be published. Required fields are marked *

Related products