Need help solving this problem: Jamaal is planning to invest up to 23,000 in City Bank or State Bank. He wants to invest at least 1,000 in city bank, but not more than 4,000; since state bank does not insure more than $21,000, he wants to invest no more than this amount in state bank. The interest at city bank is 5%, and the interest at State bank is 12%. How much should he invest in each bank to earn the most interest?