There are 10 people to be seated in a row.
Person A and Person B must be seated next to each other.
Person C and Person D must NOT be seated next to each other.
How many arrangements are possible?
We can deal with the first restriction by considering A and B as a single person, but with two different versions (AB and BA), thus with just that restriction it would be 2 * 9!.
For the second restriction you can think similarly and start with all permutations, then subtract out those that have C and D next to each other. Can you complete it?