cf Educational Codeforces Round 81 E. Permutation Separation
E.PermutationSeparationtimelimitpertest2secondsmemorylimitpertest256megabytesinputstandardinputoutputstandardoutputYouaregivenapermutationp1,p2,…,pn(anarraywhereeachintegerfrom1tonappearsexactlyonc