## main

while true
  $n = gets.strip.to_i
  break if $n == 0

  $pipes = gets.strip.split(' ').map{|s| s.to_i}
  $joints = gets.strip.split(' ').map{|s| s.to_i}
  #p $pipes
  #p $joints

  len = $pipes[0]
  num = 1

  for i in (1...$n)
    len0 = len + $pipes[i]
    len1 = len0 + $joints[i - 1]

    if len0 * (num + 1) > len1 * num
      len = len0
      num += 1
    else
      len = len1
    end
  end

  puts len * num
end