Necessary optimality conditions for constrained optimization problems under relaxed constraint qualifications