Temperature can change the state from solid to liquid causing it to melting, liquid to gas causing vaporization or a solid to a gas causing sublimation. Pressure alone cannot change the state of matter.
The law says things travel in a straight line at constant speed unless acted upon by a force. But friction is a force but it can't be seen easily other than its effect, which is to bring the object to rest in seeming violation of the 1st law.
By definition, the gain in PE (potential energy) is
ΔPE = m*g*h
Given:
mg = 40 N (Note that m*g = weight)
h = 5 m
ΔPE = (40 N)*(5 m) =200 J
Answer: 200 J