The brute-force algorithm is getting TLE. I am unable to find anything else to proceed.

Can anyone help me with a better approach?

It says “You are not allowed to view the contest” for me.

Note m can occupy only 30 bits max.

Let a be m

Let b be 2^30 +m.

We can see that a occupies first 30 bits, and b occupies last 30 bits of the available 60 bits.

Now c will be a xor b, so that a xor b xor c=0

You can see that a, b, c will be divisible by m

For you and everyone else who reads this, here’s the contest invite:

I think you mean 2^30 ***** m instead of +.

Also, nice solution.