Step 1: Drawing FBD [Ref. Fig.]
T= Tension in string
Step 2: Applying Newton's Second Law
On block 2 (Taking downward positive)
∑Fy=ma
−T+m2g=m2a ....(1)
On block 1 (Taking upward positive)
∑Fy=ma
T−m1g=m1a ....(2)
Adding Equations (1) and (2), we get
m2g−m1g=m1a+m2a
⇒ (m2−m1)g(m1+m2)=a
⇒ a=(6−3)×106+3m/s2=103m/s2
Step 3: Applying equations of motion
Since acceleration is constant, therefore applying equation of motion for block 1
(Taking upward positive)
S=ut+12at2
u=0;t=2s
S=12×103×(2)2m
=6.66m
Hence, the distance traveled by the first block is 6.66m in the first two seconds.