Optimally ending an epidemic. (4th March 2018)