You can find distance by multiplying a rate (speed/velocity) by the time traveled. d = r*t
M traveled west for 2 hours at 50 miles/hour, this is a total distance of 50 mph * 2 h = 100 mi.
Do the same thing for the east travel, and add the two numbers up for total distance traveled.
Side note: the total distance traveled here is not the same as the distance M is from where they started, since the directions traveled in each leg are opposite. If you need to find the distance from where M started, you'll have to subtract the distances, and figure out in which direction M went further. I'd recommend drawing a picture for that.