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 two new neighbours and exactly one third of the dwarves have only one new neighbour, if the number of the dwarves is a) 9; b) 12?
Problem
Source: Kyiv mathematical festival 2017
Tags: Kyiv mathematical festival, permutations, combinatorics