A general framework for optimising cost-effectiveness of pandemic response under partial intervention measures