First term, a = 24
common difference, d = 21-24 = -3
let the number of terms to get sum 78 is n.
S_n=78\\ \\ \Rightarrow \frac{n}{2}(2a+(n-1)d)=78\\ \\ \Rightarrow \frac{n}{2}(2 \times 24+(n-1)(-3))=78\\ \\ \Rightarrow n(48-3n+3)=78 \times 2\\ \\ \Rightarrow -3n^2+51n-156=0\\ \\ \Rightarrow 3n^2-51n+156=0
Solving the quadratic equation, we get n=4 and n=13.
So you can take either 4 terms or 13 terms to get the sum 78.