Consider a well of 116 mt depth and a frog at the bottom of the well. It climbs 9 mt in day time and slides down 5 mt during night.
How many days it needs to climb out of the well?
At the end of first day + night frog would have climbed = 9 - 5 = 4 m
At end of 27 days + night he would have climbed = 27*4 = 108 mts
On 28th day frog can climb 9 mts which will bring it out of the well.
So answer is 28 days.