; by (B) the proportion that— (i) the hours of required work and work preparation activities performed by the eligible participant during the month; bears to (ii) the number or hours of work and work preparation activities the State agency required the eligible participant to perform in accordance with this section. (3) Exception A State may not reduce or terminate assistance under the State program funded under this section or any other State program funded with qualified State expenditures (as defined in section 409(a)(7)(B) of the Social Security Act ( 42 U.S.C. 609(a)(7)(B) )) based on a refusal of an eligible participant to engage in work and work preparation activities required under this section if— (A) the eligible participant is a single custodial parent caring for a child who has not attained 6 years of age; and (B) the eligible participant proves that the eligible participant has a demonstrated inability (as determined by the State agency) to obtain needed child care, due to— (i) unavailability of appropriate child care within a reasonable distance from the home or work site of the eligible participant; or (ii) unavailability of all affordable child care arrangements, including formal child care and all informal child care by a relative or under other arrangements. (h) Limitation on hours of required participation in community service or workfare (1) In general The maximum number of hours during a month that an eligible participant shall be required under this section to work in a community service program or a workfare program under section 20 shall not exceed the quotient obtained by dividing— (A) the total dollar cost of all means-tested benefits received by the household for that month, as determined under paragraph (2)