Component of gravity acceleration, a=gsinθ
W=Fgd=mgsinθ.d
W=5×10sin30o.10=250J
Work done by gravity is 250J