It would take 4 hours
For the first hour you'd pay $5 at A and $6.50 at B
For the second hour you'd pay $7 at A and $8 at B
For the third hour you'd pay $9 at A and 9.50 at B
And for the fourth hour you'd pay $11 at A and $11 at B
Hope that helps you!