; (bb) eligible for medical assistance under a State plan under title XIX; or (cc) receiving aid or assistance under any plan of the State approved under title I, X, XIV, or XVI. . 202. Rebasing Target Amount for Hospitals in Territories Section 1886(b)(3) of the Social Security Act ( 42 U.S.C. 1395ww(b)(3) ) is amended by adding at the end the following new subparagraph: (M) (i) For each cost reporting period beginning on or after October 1, 2017, in the case of a hospital located in a territory of the United States, there shall be substituted for the target amount otherwise determined under subparagraph (A) the rebased target amount (as defined in clause (ii)), if such substitution results in an amount of payment under this section to the hospital for such period that is greater than the amount of payment that would be made under this section to the hospital for such period if this subparagraph were not to apply. (ii) For purposes of this subparagraph, the term rebased target amount has the meaning given the term target amount in subparagraph (A), except that— (I) there shall be substituted for the base cost reporting period the 12-month cost reporting period beginning during fiscal year 2015; (II) any reference in subparagraph (A)(i) to the first such cost reporting period is deemed a reference to the first cost reporting period beginning on or after October 1, 2017