using System; using System.Linq; class Project241{ static void Main(){ int[]Arr=new int[int.Parse(Console.ReadLine())]; Arr=Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse).ToArray(); Console.WriteLine("S = {0}", Arr.Where(x => (x>=0)).Sum()); Console.WriteLine("P = {0}", Arr.Where(x => (((Array.IndexOf(Arr,Arr.Min())>Array.IndexOf(Arr,x)) && (Array.IndexOf(Arr,Arr.Max())Array.IndexOf(Arr,x))))). Aggregate((x,y) => x*y)); } }