This may not be the best way to go about this, but...

or .

So if you go km for hours, then km per hour.

gives the total cost (in cents) combining the hourly and usage fees, so is the total cost per km.

Since you want to get the cents per km at km per hour, use the simple distance formula to arrive at: .

I'm curious to see how others would solve this problem.