Nastia and a Hidden Permutation

Problem Name:
Nastia and a Hidden Permutation
Site:CodeForces
Links:
Tags:
Problem setters: