got this thanks
Does solution which does not use bitset pass all cases? I mean in the contest discussion video I saw the person said that its essential to use bitsets to lower the constant factors by 64 or so. Also I need to learn to use these bitsets.
I tried that first. Tles by a lot ~30 seconds needed.
https://www.codechef.com/viewsolution/32286840