Life span and reproductive cost explain interspecific variation in the optimal onset of reproduction