output_description: If A is a divisor of B, print A + B; otherwise, print B - A.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B
attempt: N = int(input())
  A = list(map(int, input().split()))
  
  # ２整数の最大公約数を求める
  
  
  def gcd2(x, y):
      while y != 0:
          x, y = y, x % y
      return x
  
  
  # N 整数の最大公約数を求める
  # A = [A[0],...,A[N]] とする
  
  
  def gcd(A):
      ans = A[0]
      for i in range(1, N):  # range(1,N)= 1,2,...,N-1
          ans = gcd2(ans, A[i])
      return ans
  
  
  print(gcd(A))
  
problem_description: Statement
  
  You are given positive integers A and B.
  
  If A is a divisor of B, print A + B; otherwise, print B - A.
samples: [{"input": "4 12", "output": "16\n    \n\nAs 4 is a divisor of 12, 4 + 12 = 16 should be printed.\n\n* * *"}, {"input": "8 20", "output": "12\n    \n\n* * *"}, {"input": "1 1", "output": "2\n    \n\n1 is a divisor of 1."}]