Relation for image size
image size = Focal Length X Object size / Lens-to-object distance
form the prob focal length =12 cm
object size = m
image size = 3m
form the above formula
Lens-to-object distance= Focal Length X Object size/ Image Size
= 12 X m /3m= 4 cm
but
distance between object to image = distance object to lense
+ distance lense to image
distance between object and lense is nothing but the focal length of the lense that is 12 cm
so, distance between object to image = 12 + 4 = 16 cm