@darkshadows @atulshanbhag
what did u meant u said bit tricks can be used to check if the number is of the form 2^k - 1
please help me to find error in this problem.
Here is my sol https://www.codechef.com/viewsolution/11201858
This tricky case was extremely tricky. Couldn’t have found out without this Editorial. Awesome.