Equation relating to hours and cost