501D - Misha and Permutations Summation i am solving this problem. i find rank of both permutation in factorial number system. now i need to find sum of these 2 ranks and then find the permutation related to this rank. i am not able to get logic how to find permutation related to this rank i.e. unranking of permutation. can anyone explain it?