Let x be the number of A grade tea packages, and let y be the number of B grade packages. We want to maximize

subject to the constraints

This can be solved by drawing the latter two inequalities on a coordinate plane and using a "linear programming" technique.