Pontryagin maximum principle for the deterministic mean field type optimal control problem via the Lagrangian approach