Duality for minmax programs