Need help in Geometric Trick

Hello everyone! Can someone help me to understand the solution presented here on HackerRank here:

I’ve tried to understand the textual answer as well as the source code, but could not understand it completely. It would be of great help if someone can translate the solution into high-level sequence of steps without detailed explanation.


Hey @stalin I have discussed a solution to this problem here. It is not the approach given in the editorial, but maybe it will still help you :slight_smile: