Mariam and Riley are both driving along the same highway in two different cars to a stadium in a distant city. At noon, Mariam is 345 miles away from the stadium and Riley is 390 miles away from the stadium. Mariam is driving along the highway at a speed of 41 miles per hour and Riley is driving at speed of 56 miles per hour. Let M represent Mariam's distance, in miles, away from the stadium t hours after noon. Let R represent Riley's distance, in miles, away from the stadium t hours after noon. Write an equation for each situation, in terms of t, and determine how far both Mariam and Riley are from the stadium at the moment they are an equal distance from the stadium.

For Mariam, the equation would be:

M = 345 - 41t

For Riley, the equation would be:

R = 390 - 56t

To find the moment when both Mariam and Riley are an equal distance from the stadium, we can set M equal to R:

345 - 41t = 390 - 56t

Solving for t:

15t = 45
t = 3

Therefore, Mariam and Riley are both an equal distance from the stadium 3 hours after noon. To find how far they are from the stadium at that moment, we can substitute t = 3 into either equation. Using Mariam's equation:

M = 345 - 41(3)
M = 345 - 123
M = 222

Therefore, Mariam and Riley are both 222 miles away from the stadium at the moment they are an equal distance from the stadium.