Limak is a little bear who loves to play.
Today he is playing by moving some stones between two piles of stones.
Initially, one of the piles has **A** and the other has **B** stones in it.
Limak has decided to perform a sequence of **K** operations.
In each operation he will double the size of the currently smaller pile.
Formally, if the current pile sizes are labeled X and Y in such a way that X <= Y, he will move X stones from the second pile to the first one.
After this move the new pile sizes will be X+X and Y-X.
You are given the ints **A**, **B**, and **K**.
Determine the pile sizes after Limak finishes all his operations.
Return the size of the smaller of those piles.
Formally, suppose that the final pile sizes are labeled P and Q in such a way that P <= Q.
Return P. |