Sichuan University Programming Contest 2016 Final Warmup

A: Permutations