Hello, thank you for taking the time to post your question!
I would start by setting the cost equations for each company equal to one another so that you can find the miles driven where it’s going to be the same charge for either one
120 + 0.4M = 80 + 0.6M
40 = 0.2M
M = 40/0.2 = 200
So at 200 miles the cost is equal, anything above that is going to make company A the better deal since they have the lower rate per mile … meaning that for the cost of Company A to be less than the cost of Company B the number of miles driven must be greater than 200
I hope that helps you get moving in a better direction on this type of question! Feel free to reach out if you have any additional questions beyond that :)