Problem solution

Can anyone tell the logic of problem zco15004 problem