(* Polygon (IOI 1998) Copyright (C) 2000 Sebastiano Vigna This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Utilizziamo la programmazione dinamica per calcolare i massimi e minimi valori ottenibili con una sottoespressione che coinvolge i vertici a partire dal vertice j. Per fare cio` basta utilizzare i valori estremali delle possibili coppie di sottoespressioni di lunghezza k e i-k che partono dal vertice j e dal vertice j+k, rispettivamente. E` necessario calcolare i massimi e i minimi perche' per massimizzare un prodotto bisogna considerare il caso che un fattore sia negativo. *) Program Polygon; function max(a,b: LongInt): LongInt; BEGIN if a