I was solving a [problem](http://lightoj.com/volume_showproblem.php?problem=1080) on LightOj, my solution was correct but the problem was in the std::cout, then I replaced it to printf, then It worked fine. Plz anyone reply, why this happened.↵
↵
solution with cout [link](http://lightoj.com/volume_showcode.php?sub_id=1804615)↵
↵
solution without cout: [link](https://lightoj.com/volume_showcode.php?sub_id=1804617pastebin.com/ZtdbkWFp)↵
↵
Thanks in advance :)
↵
solution without cout: [link](https://
↵
Thanks in advance :)