help needed

can anybody help me with the logic of this question??