First find the slope, (y2-y1)/(x2-x1)=(20-10)/(40-20)=10/20=1/2
y=mx+b, where m is the slope and b is the y-intercept
y=x/2+b, using any point we can solve for b, I'll use (20, 10)
10=20/2+b
10=10+b
0=b, so the cost function is:
C(m)=m/2 (cost in dollars as a function of minutes is minutes divided by two)