In the case of an infant or child described in subparagraph (B), (C), or (D) of subsection ( l )(1) or paragraph (2) of section 1396d(n) of this title —
(A) who is receiving inpatient services for which medical assistance is provided on the date the infant or child attains the maximum age with respect to which coverage is provided under the State plan for such individuals, and
(B) who, but for attaining such age, would remain eligible for medical assistance under such subsection,
the infant or child shall continue to be treated as an individual described in such respective provision until the end of the stay for which the inpatient services are furnished.