Let x be the cups of trail mix that is 10% candy pieces
Y be the cups of trail mix that is 25% candy pieces.
Since the total is 18 cups
X + y = 18
And the mix is 20% candy
0.10x + 0.25y = 18(0.20)
Solving the equations simultaneously
X = 6 cups
Y = 12 cups