
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .bytes()
    .map(|c| c.expect("failed to read char") as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect();
  token.parse().ok().expect("failed to parse token")
}

use std::cmp::{max, min};

fn main() {
  let n = read::<i64>();
  let mut a = vec![];

  for _ in 0..n {
    let ai = read::<i64>();
    a.push(ai);
  }

  let mut a_lcm = 1;

  for i in &a {
    a_lcm = lcm(a_lcm, *i as usize);
  }
  println!("{}", a_lcm);
  let ans: i64 = a.iter().map(|x| (a_lcm - 1) as i64 % *x).sum();
  println!("{}", ans)

}

fn gcd(a: usize, b: usize) -> usize {
  if a % b == 0 {
    b
  } else {
    gcd(b, a % b)
  }
}

fn lcm(a: usize, b: usize) -> usize {
  a * b / gcd(a, b)
}

