Impacts of agriculture and dairy farming on groundwater quality: An optimization problem