Hi there!
We can begin by doing a summation of forces for each block.
Block A:
This block has the force of tension (in direction of acceleration +) and static friction (opposite direction -) acting on it. Thus:
Block B:
This block has the force of tension (opposite of acc. -) and gravity (in direction of acc +), working on it.
Add both of the expressions and solve for the maximum mass of Block B.
To find the minimum value, we can set a = 0, so:
The block must weigh > 16 kg for block A to move.