Let the number of oranges Ramesh has be x and the number of oranges Ganesh has be y.
According to the first condition,
y + 5 = 3(x - 5)
⇒ 3x - y + 10 = 0 ...(i)
According to the second condition,
x + 5 = y - 5
⇒ x - y + 10 = 0 ...(ii)
On subtracting Eq. (ii) from Eq. (i), we get x = 15
On substituting the value of x in Eq.(ii), we get y = 25
∴ The ratio of oranges to be distributed Ramesh and Ganesh = 15:25 = 3:5