A car rental agency has the following terms. If acar is rented for 5 h or less, then, the charge is Rs 60 per h or Rs 12 per km whichever is more. On the other hand, if the car is rented for more than 5 h, the charge is Rs 50 per h or Rs 7.50 per km whichever is more. Saurabh Gandhi rented a car from this agency, drove it for 30 km and ended up paying Rs 300. For how many hours did he rent the car?