The ball has 10 f/s horizontal velocity. Its vertical displacement is due to gravity so the height of the ball, h=1/2(-32)t2+20. The ball has to fall 20 feet to be caught just prior to hitting the ground allowing the minimum head start for boy(B), so it will be in the air t seconds where t2=20/16 or t=1.12 seconds. For boy(B) to catch the ball he must reach the point of impact 1.12 seconds after the ball is thrown. At 4 f/s this represents a distance of 4.48 feet. The ball will travel 10(1.12) feet horizontally while it is in the air so boy A must be 11.2-4.48 = 6.72 feet from the building when the ball is thrown. The relative velocity has a horizontal component of 10-4=6f/s. The vertical component of the relative velocity is whatever speed the ball packed up in falling for 1.12 seconds. That is 1.12*32=35.84f/s. The speed is the square root of the sum of the squares of the velocity components or 36.34f/s.
This information is brought to you by M. Casco Associates, a company dedicated to helping humankind reach the stars through understanding how the universe works. My name is James D. Jones. If I can be of more help, please let me know. JDJ