The city, town or regional school district in which each school-age child in any institution described in this section would normally be eligible to attend school and the city, town or regional school district in which each day student admitted to an institution under the control of the department of public health and receiving educational services from the department of education would normally be eligible to attend school shall pay to the commonwealth the costs of the education of that child in the school department of that institution in an amount determined according to the regulations issued under section 10. The payment for each such child shall not be less than its average per pupil cost for pupils of comparable age within the city, town or regional school district, and for each such day student, shall include any charges for related medical, educational or other service provided by the department of public health authorized by section 62T of chapter 111. The amount due the commonwealth each year shall be deducted from the annual distribution to said city, town or school district pursuant to section 20 of chapter 59.