rubik keen number permutation a permutation length n sequence consist n different number 1 n element number 1 in permutation denote aiFurik decide present Rubik come new problem permutation Furik tell Rubik number permutation permutation length n permutation b length m Rubik answer problem distinct integer d exist sequence c c1a1dc2a2dcnand length n subsequence bsequence subsequence sequence b index i1i2 in 1i1i2inm a1bi1 a2bi2 anbin n length sequence m length sequence b you give permutation b help Rubik solve give problem