Kinetic energy is 0 at the extremes in simple harmonic motion.So, Spring constant\times
amplitude\div2=0. This gives you the value of k(spring constant). Now you can solve the problem easily.
n represents the number of photons ejected from the metal. According to the frequency of the light wave & its intensity, we can obtain the no. of photons.
E=nhv