hey what's up guyz. Hope you all are doing great. I am facing difficulties to solve this problem, although I have understood the problem but I couldn't implement an optimal approach can someone write the code of this problem with explaining each part. I know that it is a very basic level problem but I just started CP that's why I am stuck on that problems. I will be very grateful if someone figure it out. Thanks for reading :)









https://mirror.codeforces.com/blog/entry/150510