class Calc0112 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @n = args.shift.first.to_i @as = args.shift.map(&:to_i) end def calc t = @as.inject(:+) / (@n - 1) [(4 * @n - t) / 2, (t - 2 * @n) / 2] end def run calc.join(' ') end end puts Calc0112.new(STDIN.readlines).run if __FILE__ == $0