The following figure shows the vertical motion of the ball.
From the figure, v−vA=−gt0−vA=−10(1)vA=10m/s since, Boy B observed the ball crossing him while up and down motion in 1s. So, the time taken by the ball to reach he floor B from floor A is 0.5 s. So s=vAt−21gt2=10×0.5−21×10×(0.5)2=5−1.25=3.75m