From the condition, you have these two equations
N - 5 = 3*(R-5) (1) ("Five years ago Nicole was three times as old as Rianne.")
N + 5 = 2*(R+5) (2) ("Five years hence . . . " )
N - 5 = 3R - 15 (3)
N + 5 = 2R + 10 (4)
Subtract eq(3) from eq(4). You will get
10 = -R + 10 - (-15)
10 = -R + 25
10 - 25 = -R ====> R = 15.
Answer. R is 15 years old. N is (from eq(4) ) N = 2R + 10-5 = 2*15+10-5 = 35 years old.