TWOCOINS Help

Can anyone tell how to solve TWOCOINS from July 17?

Are there multiple approaches to solve the problem? Please share them as well.

Thanks.

A thread already exists. two coins problem in july 2017 long contest - general - CodeChef Discuss