Optimal non-pharmaceutical intervention policy