An optimization problem with volume constraint in Orlicz spaces