POJ#1715 Combinatorics. Calculate the index of permutation. Rank:11559