#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return (gcd(b, a % b));
}
int main() {
  int n;
  cin >> n;
  long long int lcm = 1;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) {
    lcm = lcm * a[i] / gcd(lcm, a[i]);
  }
  long long int ans = 0;
  cout << lcm << endl;
  for (int i = 0; i < n; ++i) {
    ans += lcm % a[i];
  }
  cout << ans << endl;
}
