A single algorithm for both restless and rested rotting bandits