#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <queue>
#include <limits>
#include <algorithm>
#include <string>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
 
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back


mp::cpp_int gcd(mp::cpp_int x, mp::cpp_int y)
{
    mp::cpp_int r;

    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

mp::cpp_int lcm(mp::cpp_int x, mp::cpp_int y)
{
    return (x * y / gcd(x, y));
}

int main() {
    mp::cpp_int N;
    cin >> N;
    std::vector<mp::cpp_int> A(N);
    rep(i,N) cin >> A[i];
    mp::cpp_int tmp=lcm(A[0],A[1]);
    for(int i = 2; i < N;i++){
        tmp = lcm(tmp, A[i]);
    }
    cout << tmp << endl;
    tmp -= 1;
    mp::cpp_int ans=0;
    for(int i = 0; i < N;i++){
        ans += tmp % A[i];
    }
    cout << ans << endl;
	return 0;
}