Stationary distribution of the surplus in a risk model with dividends and reinvestments