The title is self explanatory, Here's the problem link : https://mirror.codeforces.com/contestInvitation/7a2de3f17076e09f1454e50f400bcf5b1e591d4b Thanks weirdflexbutok,goats_9 for providing idea for the solution.
Edit: Here's the solution code : https://ideone.com/rzP3jW.
Check out : 1) https://mirror.codeforces.com/blog/entry/144152 2) https://mirror.codeforces.com/blog/entry/144422. Hope you and I find ourselves good till my next post.








