If the number of workers decreases, the time to taken built the wall increases in the same proportion. Clearly, number of workers varies inversely to the number of days.
So here x1y1=x2y2 where
x1=36 workers y1=12 days
x2=16 workers and y2=? days
Substitute, 3616=y212 ⇒ y2=12×3616=27 days
Therefore 16 workers will build the same wall in 27 days.