Calculates optimal appointments by adding remaining pills to the new cycle length ($X + \text{duration}$).