Section 76. Any such school committee shall establish as one of the rules of admission to the benefits of such extended course of instruction that the persons therein enrolled, or responsible agents acting in their behalf, shall pay into the treasury of such city or town, toward the cost of maintaining such course, such sum, not exceeding the actual cost thereof, as said school committee shall determine. If a city or town does not maintain such course of instruction, it may pay the charge authorized by this section in the case of any person who resides therein and obtains from its school committee a certificate to take the course in another city or town maintaining the same.