Optimal control of the coronavirus pandemic with both pharmaceutical and non-pharmaceutical interventions