Twist the Permutation

Problem Name:
Twist the Permutation
Site:CodeForces
Links:
Tags:
Problem setters: