How to solve problem ZERO from Dream Code 2.0?

Can anyone share their approach for solving [ZERO] from Dream Code 2.0 contest? (CodeChef: Practical coding for everyone)

Its a direct application of meet in the middle.
You can learn it from -