From the condition, the speeds of the trains A and B are 7x and 8x kilometers per hour, respectively,
where x is the common measure of their speeds.
Therefore, for the total distance of 450 kilometers, you can write an equation
2*(7x) + 2*(8x) = 450.
Simplify and solve for x
14x + 16x = 450,
30x = 450,
x = = 15.
ANSWER. The train A speed is 7*15 = 105 kilometers per hour; the train B speed is 8*15 = 120 kilometers per hour.