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: m = list(map(int, input().split()))
  
  hp = list(map(int, input().split()))
  result = 0
  checkyakusuru = []
  checkodd = []
  checkeven = []
  
  if hp.count(hp[0]) == m[0]:
      result = hp[0]
  
  minhp = min(hp)
  
  for p in hp:
      if p % minhp == 0:
          checkyakusuru.append(1)
  
      if checkyakusuru.count(1) == m[0]:
          result = p
          break
      else:
          if p % 2 == 0:
              checkeven.append(1)
          if checkeven.count(1) == m[0]:
              result = 2
          else:
              result = 1
  
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."}]