Question Link: https://codeforces.net/contest/1539/problem/B
Submission Link: https://codeforces.net/contest/1539/submission/120683760
Can someone help me with this submission, I am getting exit code 2, this is working fine on my console, but submission is failing.