Consider the economy of Citronia, where citizens consume only oranges. Assume that oranges cost $1 each, and each person can buy at most 5,000 oranges. The government has devised the following tax plans:

Plan A Plan B
Consumption up to 1,000 oranges is taxed at 20%. Consumption up to 2,000 oranges is taxed at 30%.
Consumption higher than 1,000 oranges is taxed at 80%. Consumption higher than 2,000 oranges is taxed at 10%.

Required:
Derive the marginal and average tax rates under each tax plan at the consumption levels of 500 oranges.