Count the permutation

Problem Name:
Count the permutation
Site:HackerEarth
Links:
Tags:
Problem setters: