; and (ii) qualified local educational agencies in the State with the highest percentages of students counted under such section. (B) Geographic diversity The State shall ensure that grants under this section are awarded to qualified local educational agencies that represent the geographic diversity of the State. (3) Statewide thresholds The State shall establish reasonable thresholds for determining whether a local educational agency is among agencies in the State with the highest numbers or percentages of students counted under section 1124(c) of the Elementary and Secondary Education Act of 1965 ( 20 U.S.C. 6333(c) ) as required under paragraph (1)(A). (c) Priority of grants In awarding grants under this section, the State shall give priority to qualified local educational agencies that— (1) (A) demonstrate the greatest need for such a grant, as determined by a comparison of the factors described in subsection (b)(1) and other indicators of need in the public school facilities of such local educational agencies, including— (i) the median age of facilities; (ii) the extent to which student enrollment exceeds physical and instructional capacity; (iii) the condition of major building systems such as heating, ventilation, air conditioning, electrical, water, and sewer systems; (iv) the condition of roofs, windows, and doors; and (v) other critical health and safety conditions; (B) will use the grant to improve the facilities of— (i) elementary schools or middle schools that have an enrollment of students who are eligible for a free or reduced price lunch under the Richard B. Russell National School Lunch Act ( 42 U.S.C. 1751 et seq. ) that constitutes not less than 40 percent of the total student enrollment at such schools