#include <bits/stdc++.h>
int sosuhantei(int a) {
  for (int i = 2; i <= a; i++) {
    if (i == a) {
      return 1;
    } else if ((a % i) == 0) {
      return 0;
    }
  }
  return 0;
}
int main() {
  int N;
  scanf("%d", &N);
  int a[N];
  for (int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  int M = 1;
  int len = sizeof(a) / sizeof(a[0]);
  for (int j = 2; j <= 100000; j++) {
    if (sosuhantei(j) == 1) {
      for (int i = 0; i < len; i++) {
        if (a[i] % j == 0) {
          M *= j;
          break;
        }
      }
    }
  }
  printf("%d\n", M);
  int max = 0;
  for (int m = 0; m < M; m++) {
    int f = 0;
    for (int i = 0; i < N; i++) {
      f += m % a[i];
    }
    if (f > max) max = f;
  }
  printf("%d\n", max);
  return 0;
}
