Agis interview question

Two profitability cases