using System;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            MainStream();
        }
        static void MainStream()
        {
            int n = int.Parse(Console.ReadLine());
            string[] a_list_tmp = Console.ReadLine().Split(' ');
            ulong[] a_list = a_list_tmp.Select(s => ulong.Parse(s)).ToArray();

            Array.Sort(a_list);

            ulong lcm = a_list[0];
            for(int i=1; i<n; i++)
            {
                lcm = Lcm(lcm, a_list[i]);
            }
            Console.WriteLine(lcm);
            ulong max = 0;

            for (ulong i=1; i<lcm; i++)
            {
                ulong sum = 0;
                for(int j=0; j<n; j++)
                {
                    sum += (i % a_list[j]);
                }
                if(sum > max)
                {
                    max = sum;
                }
            }
            Console.WriteLine(max);
        }

        static ulong Gcd(ulong a, ulong b)//最大公約数
        {
            return (a < b) ? Gcd(b, a) : (b > 0) ? Gcd(b, a % b) : a;
        }

        static ulong Lcm(ulong a, ulong b)//最小公倍数
        {
            return a / Gcd(a, b) * b;
        }
    }
}
