Generalized non-stationary bandits