Can someone explain this solution ?
Codeforces.com/gym/101908/problem/L Can anyone explain how and why this logic works
.