; and (II) the Federal share of the cost of an individual project in this subsection may be up to 100 percent. (ii) Aggregate non-Federal share The average annual non-Federal share of the total cost of all projects for which funds are obligated under this subsection in a State for a fiscal year shall be not less than the non-Federal share authorized for the State under section 120(b). (iii) Requirement This subparagraph shall only apply to a State if such State has adequate financial controls, as certified by the Secretary, to account for the average annual non-Federal share under this subparagraph. (B) Safety projects Notwithstanding section 120, funds made available to carry out section 148 may be credited toward the non-Federal share of the costs of a project under this subsection if the project— (i) is a project described in section 148(e)(1); and (ii) is consistent with the State strategic highway safety plan (as defined in section 148(a)). (8) Flexibility (A) State authority (i) In general A State may use not more than 50 percent of the funds set aside under this subsection that are available for obligation in any area of the State (suballocated consistent with the requirements of subsection (d)(1)(B)) for any purpose eligible under subsection (b). (ii) Restriction Funds may be used as described in clause (i) only if the State demonstrates to the Secretary that the State— (I) held a competition in compliance with the requirements of this subsection in such form as the Secretary determines appropriate; (II) offered technical assistance to all eligible entities and provided such assistance upon request by an eligible entity