PROBLEM IITI15

http://www.codechef.com/DBYZ2014/problems/IITI15/

CAN ANYBODY PLEASE EXPLAIN ME THIS PROBLEM I KNOW THE USE OF BIT BUT DOES NOT ABLE TO COME UP WITH AN IDEA TO SOLVE THIS PROBLEM SO PLEASE HELP…