A school uses two different types of graphing calculators. Basic graphing calculators cost $80
each and CAS graphing calculators cost $100 each. The school needs between 40 and 80 CAS
graphing calculators for their advanced math classes and at least 300 basic graphing calculators
for all other math and science classes. The school earns $1 in rewards for each basic calculator
and $2 in rewards for each CAS calculator and expect to earn at most $520 in rewards through
this purchase. How many of each type should they purchase to minimize cost?