output_description: Print the maximum number of candies that can be collected.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_{1, 1} A_{1, 2} ... A_{1, N}
      A_{2, 1} A_{2, 2} ... A_{2, N}
attempt: import sys
  from itertools import accumulate
  
  
  def resolve():
      input = sys.stdin.readline
      N = int(input().rstrip())
      A1 = list(map(int, input().rstrip().split()))
      A2 = list(map(int, input().rstrip().split()))
  
      csumA1 = [0] + A1
      csumA2 = [0] + A2
      csumA1 = list(accumulate(csumA1))
      csumA2 = list(accumulate(csumA2))
      sum = 0
      for i in range(1, N + 1, 1):
          sumA1 = csumA1[i] - csumA1[0]
          sumA2 = csumA2[N] - csumA2[i - 1]
          sum = max(sum, sumA1 + sumA2)
      print(sum)
  
  
  from io import StringIO
  import unittest
  
  
  class TestClass(unittest.TestCase):
      def assertIO(self, input, output):
          stdout, stdin = sys.stdout, sys.stdin
          sys.stdout, sys.stdin = StringIO(), StringIO(input)
          resolve()
          sys.stdout.seek(0)
          out = sys.stdout.read()[:-1]
          sys.stdout, sys.stdin = stdout, stdin
          self.assertEqual(out, output)
  
      def test_入力例_1(self):
          input = """5
  3 2 2 4 1
  1 2 2 2 1"""
          output = """14"""
          self.assertIO(input, output)
  
      def test_入力例_2(self):
          input = """4
  1 1 1 1
  1 1 1 1"""
          output = """5"""
          self.assertIO(input, output)
  
      def test_入力例_3(self):
          input = """7
  3 3 4 5 4 5 3
  5 3 4 4 2 3 2"""
          output = """29"""
          self.assertIO(input, output)
  
      def test_入力例_4(self):
          input = """1
  2
  3"""
          output = """5"""
          self.assertIO(input, output)
  
  
  if __name__ == "__main__":
      # unittest.main()
      resolve()
  
problem_description: Statement
  
  We have a 2 \times N grid. We will denote the square at the i-th row and j-th
  column (1 \leq i \leq 2, 1 \leq j \leq N) as (i, j).
  
  You are initially in the top-left square, (1, 1). You will travel to the
  bottom-right square, (2, N), by repeatedly moving right or down.
  
  The square (i, j) contains A_{i, j} candies. You will collect all the candies
  you visit during the travel. The top-left and bottom-right squares also
  contain candies, and you will also collect them.
  
  At most how many candies can you collect when you choose the best way to
  travel?
samples: [{"input": "5\n    3 2 2 4 1\n    1 2 2 2 1", "output": "14\n    \n\nThe number of collected candies will be maximized when you:\n\n  * move right three times, then move down once, then move right once.\n\n* * *"}, {"input": "4\n    1 1 1 1\n    1 1 1 1", "output": "5\n    \n\nYou will always collect the same number of candies, regardless of how you\ntravel.\n\n* * *"}, {"input": "7\n    3 3 4 5 4 5 3\n    5 3 4 4 2 3 2", "output": "29\n    \n\n* * *"}, {"input": "1\n    2\n    3", "output": "5"}]