.
The total number of all possible line-ups is equal to the number of all permutations of 9 objects. i.e. 9! = 9*8*7*6*5*4*3*2*1.
From this number, you should subtract the number of all line-ups, where these 3 persons follow each other.
The number of such line-ups is 7*6!*3!= 7*(6*5*4*3*2*1)*(3*2*1).
The very first factor of 7 accounts for any of 7 possible positions of this triple in the line.
The factor 6! accounts for all possible permutations of remaining 9-3 = 6 persons.
Finally, the factor 3! accounts for all internal permutations inside this triple.
Thus the final answer is
9*8*7*6*5*4*3*2*1 - 7*(6*5*4*3*2*1)*(3*2*1) = 332640. ANSWER
Solved.