Edit : I’m extremely sorry, this contest is still going on. I didn’t know that. Please do not post solutions until the contest is over. Sorry again.
https://www.codechef.com/ISCC2018/problems/T30
How to approach this problem? I tried solving it for a long time but couldn’t come up with anything.
Also, the contest is over, but I’m unable to view other solutions. Thanks in advance