Assuming that the two blocks move together, then the Common acceleration is ac=Fm1+m2=2015=43m/s2
From FBD of B: Required frictional force f to make them move together is f=mac=5×43=203N Since, 203N<50N ⇒f<fmax, it means our assumption was right, they will move together Hence, aA=aB=43m/s2