x= No. of marbles sham having after distribution (fst sentence)
y= marbles distributed to ram (fst sentence)
n= marbles ram gave to sham
since sham gave n marbles to ram, thus n is added to x and also n is deducted from y (ram) bcos ram gave it. so equation becomes.
(x+n) = 2 (y-n)
X+y =90. (total)
y-n = 2x ( at the end , sham found ram is having double the marbles of what sham inital had i.e.x)
thus, n =3x.
also x+3n = 2y
or 10x = 2y
N= 45 (answer).