Help in RROUNDS

The problem is here . Can someone explain the logic behind the solution. I saw majority of solutions uses a formula but wanted to know how they reached there. @vijju123 @taran_1407