Many many years ago , there was a king who has three daughters , each one of them lives in a palace , one day the king wanted to visit his daughter so he took few golden coins and visited the first palace.
in the palace he had to give the guard 10 golden coins when he enters the palace and 10 coins when he leaves and when he meets his daughter she gives him as much as he has .
this process was repeated in the second and third palace
When the king left the third palace and gave the guard 10 coin his pocket got empty.
The question is how much coins the king took when he went to visit his daughters??
so you start the opposite way to make the equation ((((x-10)*2-10-10)*2-10)-10)*2-10=0 we make that (((x-10)*2-10-10)*2-10)-10=5 then it becomes (((x-10)*2-10-10)*2=25 and ((x-10)*2-10-10)=12.5 which is (x-10)*2=32.5 so that is x-10=16.25 so x=26.25 and he got 26.25 gold coins when he started