Dynamically weighted multireference perturbation theory: Combining the advantages of multi-state and state-averaged methods.