Showing wrong answer

I am doing this question from codeforces…
https://codeforces.com/problemset/problem/1401/C
This is my solution… But it is showing wrong answer on first test case…
Please see my code…
where it is missing…


Thanks

hello @ashishnnnnn
instead of using pair , use two array , one for given array, and one that u want to sort and then check order for those elements that are fixed . if their order is different that means answer is not possible otherwise possible.