a) when A has no velocity at the bottom it means that all potential energy of A is conducted to the spring:
m*g*h = 0.5*k*x^2
where m=20, h=3,g=9.8, x=3
solve for k
k=11.4 N/m
b) so its height is 0.5 m, at that position it has a velocity of v, lets use conservation of energy
initially there is only potential energy = mgh
when mass is at0.5 m then there is again a potential energy but smaller, a kinetic energy and also energy stored in the spring. They are totally:
m*g*h1 + 0.5*m*v^2 + 0.5*k*x^2 = m*g*h
20*9.8*0.5 +0.5*20*v^2 +0.5*11.4*2.5^2 = 20*9.8*3
solve for v= 6.74 m/s
enjoy