Why my code gives wrong ans in codeforces and correct on local ide?

Revision en1, by fazer02, 2022-05-11 17:51:39

So I was giving Codeforces Round #790 Div 4. I solved B (not efficiently) however my code gave wrong ans. After the contest was over I looked for the test case and ran in my personal ide. It worked fine there. It was also running on onliegdb.com

Link to my solution: https://codeforces.com/contest/1676/submission/156648104

I want to know why isn't my code running as intended? Thanks for any help!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English fazer02 2022-05-11 17:51:39 473 Initial revision (published)