Думаю, что найденное решение неверно. Следуя принятому принципу (включения-исключения) получается следующее решение:
Код:
{[A, C, A, K, P, K], [A, C, K, A, K, P], [A, C, K, A, P, K], [A, C, K, P, A, K], [A, C, K, P, K, A], [A, C, P, K, A, K], [A, K, A, C, K, P], [A, K, A, C, P, K], [A, K, A, K, C, P], [A, K, A, K, P, C], [A, K, A, P, C, K], [A, K, A, P, K, C], [A, K, C, A, K, P], [A, K, C, A, P, K], [A, K, C, K, A, P], [A, K, C, K, P, A], [A, K, C, P, A, K], [A, K, C, P, K, A], [A, K, P, A, C, K], [A, K, P, A, K, C], [A, K, P, C, A, K], [A, K, P, C, K, A], [A, K, P, K, A, C], [A, K, P, K, C, A], [A, P, A, K, C, K], [A, P, C, K, A, K], [A, P, K, A, C, K], [A, P, K, A, K, C], [A, P, K, C, A, K], [A, P, K, C, K, A], [C, A, K, A, K, P], [C, A, K, A, P, K], [C, A, K, P, A, K], [C, A, K, P, K, A], [C, A, P, K, A, K], [C, K, A, K, A, P], [C, K, A, K, P, A], [C, K, A, P, A, K], [C, K, A, P, K, A], [C, K, P, A, K, A], [C, P, A, K, A, K], [C, P, K, A, K, A], [K, A, C, A, K, P], [K, A, C, A, P, K], [K, A, C, K, A, P], [K, A, C, K, P, A], [K, A, C, P, A, K], [K, A, C, P, K, A], [K, A, K, A, C, P], [K, A, K, A, P, C], [K, A, K, C, A, P], [K, A, K, C, P, A], [K, A, K, P, A, C], [K, A, K, P, C, A], [K, A, P, A, C, K], [K, A, P, A, K, C], [K, A, P, C, A, K], [K, A, P, C, K, A], [K, A, P, K, A, C], [K, A, P, K, C, A], [K, C, A, K, A, P], [K, C, A, K, P, A], [K, C, A, P, A, K], [K, C, A, P, K, A], [K, C, K, A, P, A], [K, C, P, A, K, A], [K, P, A, C, A, K], [K, P, A, C, K, A], [K, P, A, K, A, C], [K, P, A, K, C, A], [K, P, C, A, K, A], [K, P, K, A, C, A], [P, A, C, K, A, K], [P, A, K, A, C, K], [P, A, K, A, K, C], [P, A, K, C, A, K], [P, A, K, C, K, A], [P, C, A, K, A, K], [P, C, K, A, K, A], [P, K, A, C, A, K], [P, K, A, C, K, A], [P, K, A, K, A, C], [P, K, A, K, C, A], [P, K, C, A, K, A]}
Evgenjy, может быть Вы укажете лишние комбинации?