A log of mass 1 kg slides on a horizontal rough surface and encounters a flexible spring of a force constant which is attached to a wall as shown in the figure below. After the collision of the log with the spring, the spring is compressed by 4.0 cm. What is the speed of the log at the moment it hits the spring if the coefficient of friction between the log and the surface is 0.25?