let the acceleration of block A be a1 and block B a2 and the tension in string attached to A be T.
this implies the tension in string attached block B as 2T.
by using virtual work principal 2Tx2=Tx1
2a2=a1
5g-2T=5a2
T=2a1
5g=2T+5a2
5g=13a2
a2=5g/13
a1=10g/13