$POJ2279\ Mr.Young's\ Picture\ Permutations\ dp$

NoSuchKey