CODERS BIT Doubt (From a contest which has ended)

Can anyone help in telling the correct approach to these problems?