Answer:
M g - T = M a acceleration of hanging block (M = 2)
2 g - T = 2 a where M = 2
T = 2 g - 2 a
T = 8 * a + 12 N acceleration of blocks on table
2 g - 2 a = 8 a + 12
10 a = 2 g - 12
a = .8 m/s^2 (assuming g = 10 m/s^2)
T = 2 g - 2 a = 2 * 10 - 2 * .8 = 20 - 1.6 = 18.4 N
Check: For blocks on table
a = (18.4 - 12) / 8 = 6.4 / 8 = .8 m/s^2