Several dwarves were lined up in a row, and then they lined up in a row in a different order. Is it possible that exactly one third of the dwarves have both of their neighbours remained and exactly one third of the dwarves have only one of their neighbours remained, if the number of the dwarves is a) 6; b) 9?
Problem
Source: Kyiv mathematical festival 2017
Tags: permutations, Kyiv mathematical festival, combinatorics