Adam, Bob and Charles, members of a certain team, insisted on sticking together, while taking their places on a bench, accommodating the whole team of n people, - while Dan and Eddy would not like to be placed one next to another.
In how many ways may all these requests be met, if n = 5, 8, 10.

Rem: Computer programs allowed only as verification of your analytically produced results.

A, B and C initially count as one person in placing the teammates, but then the solution count has to be multiplied by 6 to account for the shuffling within that group.

Initially that gives us 6 * (n-2)!, but from this we must subtract out those orders in which D and E are together. That can be calculated in the same manner as A, B and C together: twice what you'd get considering D and E as one person. So that comes to 12 * (n-3)!