The normal shift produced by a glass slab is,
`S=(1-(1)/(mu))t=(1-(2)/(3))(6)=2cm`
i.e., for the mirror the object is placed at a distanced `(32-S)=30cm` from it.
Applying mirror formula `1/v+1/u=1/f`
or `1/v+(1)/(30)=-(1)/(10)`
or `v=-15cm`
a. When `x=5cm`: The light falls on the slab on its return journey as shown. But the slab will again shift it by a distanc `S=2cm`. Hence, the final real image is formed at a distance `(15+2)=17 cm` from the mirror.
b. When `x=20cm`: This time also the final image is at a distance `17 cm` from the mirror but it is virtual as shown.