I am new to this forum and also recently started coding practice on Codechef.
I was trying to solve this problem. My solution works fine with the example input but getting Runtime Error (NZEC) while submitting it. My submission code is 26613220.
Will appreciate any help on this. Also is there a way to find out error stack while submitting the code?
Thanks yash4421 for taking an interest in this. I understand your suggestion but what I am more interested is to find out problem with my approach rather than a solution.