WA on CHEFUNI

I implemented the solution after referring the problem editorial, Maybe I’m missing something here.

Problem : Chef and Universe
Code: https://pastebin.com/NdtgnAqE