Ramon plans to sell his car and places an ad with x lines. The newspaper charges y dollars for the first g lines and p dollars per extra line to run the ad for a week. If x>g, express the cost of running the ad for a week algebraically.