solve math puzzle logic question