Why i'm getting wrong answer?

https://www.codechef.com/JULY18B/problems/MGCSET
https://ide.codingblocks.com/#/s/16531