Hello Ekaterina,
Let's let
d = $ rate per day
m = $ rate per mile
Based on Barney's charge
3d + 300m = 111
Based on Mary's charge
5d + 600m = 197
So our system of linear equations is
3d + 300m = 111
5d + 600m = 197
Multiply the 1st equation by -2
-6d - 600m = -222
5d + 600m = 197
Add the two equations together, eliminating the m variable
-d = -25
d = 25
Evaluate either original equation for d=25 and solve for m
3d+300m=111
3(25)=300m=111
75+300m=111
300m = 36
m = 0.12
The charge per day is $25. The charge per mile is $0.12.