Hi,
I found this quite an interesting question, because I couldn't think of a straight forward way to solve it. Obviously a brute force solution is out of the question as there are 120 combinations. This is the best I could come up with:
We know that A must be before B so there are 3 regions in which we can place the other people region p(left of A), q(between A and B), and r(right of B).
p A q B r
We have 3 pieces to place in these regions, the ways we can do that are:
| p | q | r |
|---|
| 3 | 0 | 0 |
| 2 | 1 | 0 |
| 2 | 0 | 1 |
| 1 | 2 | 0 |
| 1 | 1 | 1 |
| 1 | 0 | 2 |
| 0 | 3 | 0 |
| 0 | 2 | 1 |
| 0 | 1 | 2 |
| 0 | 0 | 3 |
In each of these configurations CDE can be assigned any way you like (3! ways) and there are 10 configurations so that makes 10*3!=10*6=60 different ways.