K-th permutation of length N in lexicographical order
CodeChef Starters 132 Solution Discussion
Codeforces Round 943 Solution Discussion