↵
[submission link](https://codeforces.me/problemset/submission/1461/195711147)↵
↵
↵
I am getting the right answer when running the testcases locally however codeforces when running the code on their servers gives a different output. Can anyone explain what's happening here. Any help is appreciated. Thanks.