Optimal policies for mitigating pandemic costs: a tutorial model