Problem:


Score : 100 points

Problem Statement

You are given positive integers A and B.

If A is a divisor of B, print A + B; otherwise, print B - A.

Constraints

All values in input are integers.

1 \leq A \leq B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

If A is a divisor of B, print A + B; otherwise, print B - A.

Sample Input 1

4 12

Sample Output 1

16

As 4 is a divisor of 12, 4 + 12 = 16 should be printed.

Sample Input 2

8 20

Sample Output 2

12

Sample Input 3

1 1

Sample Output 3

2

1 is a divisor of 1.



Sample input:
4 12


Sample output:
16

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if(b%a==0):
    print(b+a)
else:
    print(b-a)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
print(B-A if B%A else A+B)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())

if b%a == 0:
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print((-1)**(b%a != 0)*a+b)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if b%a==0:
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())

if b % a == 0:
    print(a+b)
else:
   print(b-a)

Submission status: Accepted

Solution code:
a,b=map(int,input().split());print(b-a if b%a else b+a)

Submission status: Accepted

Solution code:
def main():
    A, B = map(int, input().split())
    if B % A == 0: return A+B
    else: return B- A

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
#coding:utf-8
a, b = map(int, input().split())

if b % a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a <= a <= b <= 20:
    if 0 == b % a:
        print(a + b)
    else:
        print(b - a)
else:
    print('hoge')

Submission status: Accepted

Solution code:
a,b = map(int,input().split())


if b % a == 0:
    print(a + b)
else:
    print(b - a)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print('{0}'.format(a+b) if b%a==0 else '{0}'.format(b-a))

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
if b % a == 0:
	print(a+b)
else:
	print(b-a)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())

print(b-a if b%a else a+b)

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))

if b % a == 0:
  print(a + b)
else:
  print(b - a)

Submission status: Accepted

Solution code:
a,b=map(int, input().split())

if b%a==0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

print(a+b if b%a ==0 else b-a)

Submission status: Accepted

Solution code:
A, B=map(int,input().split())
 
N = B % A
 
if N==0:
  Ans = A+B
else:
  Ans = B-A

print(Ans)

Submission status: Accepted

Solution code:
a,b=[int(e) for e in input().split()]
if(b%a==0):print(a+b)
else:print(b-a)

Submission status: Accepted

Solution code:
list1 = [i for i in input().split()]

num1 = int(list1[0])
num2 = int(list1[1])

if num2 % num1 == 0:
    print (num1+num2)
else:
    print (num2-num1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

a, b = map(int, input().split())
if b % a:
    print(b-a)
else:
    print(a+b)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if B % A == 0:
  print(A+B)
else:
  print(B-A)

Submission status: Accepted

Solution code:
def solve():
    a, b = map(int, input().split())
    return a + b if b % a == 0 else b - a


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

print([A+B,B-A][B%A!=0])

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
print(a+b if b % a == 0 else b-a)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)

Submission status: Accepted

Solution code:
a,b=input().split()
a,b=int(a),int(b)

if b%a==0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
def test():
    a,b = map(int,input().split())

    if b % a == 0:
        print(a+b)
    else:
        print(b-a)


if __name__ == "__main__":
    test()

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if 0==B%A: print(A+B)
else: print(B-A)

Submission status: Accepted

Solution code:
import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()

a = int(inputa[0])
b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

if b % a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())

if b % a == 0:
    print(b + a)
else:
    print(b - a)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

if B % A == 0:
	print(A+B)
else:
	print(B-A)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
flag=0

for i in range(1,21):
    if B/A==i:
        flag+=1
        
if flag==0:
    print(B-A)
else :
    print(A+B)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if b % a:
    print(b - a)
else:
    print(a + b)

Submission status: Accepted

Solution code:
a, b = map(int, input().split(' '))
if b%a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

print (A+B if B % A == 0 else B-A)

Submission status: Accepted

Solution code:
a, b = map(int, input().split(" "))
if b % a == 0:
  print(a + b)
else:
  print(b - a)

Submission status: Accepted

Solution code:
a,b=map(int,input().split()); print(b-a if b%a else b+a)

Submission status: Accepted

Solution code:
a, b = map(int,input().split())

if b%a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
print(A+B if B%A==0 else B-A)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

if B%A == 0:
  print(A+B)
else:
  print(B-A)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
print((str(b-a),str(a+b))[b%a==0])

Submission status: Accepted

Solution code:

A, B = map(int, input().split())
if B % A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())

if b%a ==0 :
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
a, b = map(int, input().split(' '))
print(a + b if b % a == 0 else b - a)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
print(B-A if B%A else A+B)

Submission status: Accepted

Solution code:
#約数列挙
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

def main():
    A,B = map(int, input().split())
    div_list = make_divisor_list(B)

    if A in div_list:
        print(A+B)
    else:
        print(B-A)


if __name__ == '__main__' :
    main()

Submission status: Accepted

Solution code:
a,b=(int(x) for x in input().split())
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
a,b = list(map(int,input().split()))
if b%a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
L = input().split()
A = int(L[0])
B = int(L[1])
if B % A == 0:
  print(A + B)
else:
  print(B - A)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
print(a+b) if b%a==0 else print(b-a)

Submission status: Accepted

Solution code:
#118 B +/- A

A, B = map(int, input().rstrip().split())

if B%A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
a,b = map( int, input().split() )

ret = 0;

if b % a == 0:
  ret = b + a
else:
  ret = b - a
    
print(ret )

Submission status: Accepted

Solution code:
a,b = map( int, input().split() )

ret = 0;

if a > b:
  if a % b == 0:
    ret = a + b
  else:
    ret = a - b
else:
  if b % a == 0:
    ret = b + a
  else:
    ret = b - a
    
    
print(ret )

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if b % a == 0:
  print(a + b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
"""
# 標準入力取得
## 文字列
     = sys.stdin.readline().rstrip()
     = list(sys.stdin.readline().rstrip())

## 数値
     = int(sys.stdin.readline())
     = map(int, sys.stdin.readline().split())
     = list(map(int, sys.stdin.readline().split()))
     = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    A, B = map(int, sys.stdin.readline().split())
    if B % A == 0:
        print(A + B)
    else:
        print(B - A)

Submission status: Accepted

Solution code:
num = input().split()
a, b = int(num[0]), int(num[1])
if b%a==0: print(a+b)
else: print(b-a)

Submission status: Accepted

Solution code:
#18:39
a,b = map(int,input().split())
if b % a == 0:
  print(b+a)
else:
  print(b-a)

Submission status: Accepted

Solution code:
#118
a, b = (int(_) for _ in input().split())
if b % a == 0:
    print(a + b)
else:
    print(b - a)

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
if B%A==0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:


a, b = [int(x) for x in input().split()]
print(a + b if b % a == 0 else b - a)

Submission status: Accepted

Solution code:
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    A,B = map(int, sys.stdin.readline().split())
    if B%A==0:
        print(A+B)
    else:
        print(B-A)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())

if B % A == 0:
    ans = A + B
else:
    ans = B - A
print(ans)

Submission status: Accepted

Solution code:
ab = list(map(int, input().split(' ')))
a = ab[0]
b = ab[1]
if b % a == 0:
    print(a + b)
else:
    print(b - a)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

A, B = map(int, input().split())

# print(A)
# print(B)

# print(B % A == 0)

if B % A == 0:
    print(A + B)
else:
    print(B - A)

Submission status: Accepted

Solution code:
a,b=map(int,input().split());print(b-a*(2*(b%a>0)-1))

Submission status: Accepted

Solution code:
a,b=map(int,input().split());print(b+a*(2*(not b%a)-1))

Submission status: Accepted

Solution code:
A, B = map(int, input().split(" "))
if B % A == 0:
  print(A + B)
else:
  print(B - A)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
if y % x == 0:
  print(x+y)
else:
  print(y-x)

Submission status: Accepted

Solution code:
l = [int(i) for i in input().split(" ")]
if l[1]%l[0] == 0:
    print(l[0]+l[1])
else:
    print(l[1]-l[0])

Submission status: Accepted

Solution code:
ab = [int(i) for i in input().split()]

a = ab[0]
b = ab[1]

if b % a == 0:
	print(a+b)
else:
	print(b-a)

Submission status: Accepted

Solution code:

a,b=map(int,input().split())
print(a+b if b%a==0 else b-a)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())

if b%a==0:
	res=b+a
else:
	res=b-a

print(res)

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
print(A+B if B%A==0 else B-A)

Submission status: Accepted

Solution code:
x, y = map(int, input().split(' '))
if y % x == 0:
    print(x+y)
else:
    print(y-x)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
C = B%A
if (C == 0):
  print(A+B)
else:
  print(B-A)

Submission status: Accepted

Solution code:
print(*[x[1] + (x[0] if x[1]%x[0]==0 else -x[0]) for x in [[int(x) for x in input().split()]]])

Submission status: Accepted

Solution code:
def main24():
    data = input().split()
    num = []
    for i in range(2):
        num.append(int(data[i]))
    if num[1] % num[0] == 0:
        print((num[0]+num[1]))
    else:
        print((num[1]-num[0]))

if __name__ == "__main__":
    main24()

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

if B%A ==0:
    print(A + B)
else:
    print(B - A)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if b%a ==0:print(a+b)
else:print(b-a)

Submission status: Accepted

Solution code:


def main():
    A,B = map(int,input().split())
    
    if(B%A==0):
        print(A+B)
    else:
        print(B-A)
    










if __name__== "__main__":
    main()

Submission status: Accepted

Solution code:
A, B = map(int,input().split())
if B%A == 0 :
  print(A+B)
else :
  print(B-A)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if b%a :
    print(b-a)
else:
    print(a+b)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
print([y-x,x+y][y%x==0])

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
x = A + B if B % A == 0 else B - A
print(x)

Submission status: Accepted

Solution code:
a, b  = map(int, input().split())

if b% a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
print(A+B if B % A == 0 else B-A)

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))

if b % a == 0:
	print(a+b)
else:
	print(b-a)

Submission status: Accepted

Solution code:
def main():

    """ convenient functions
    # for i, a in enumerate(iterable)
    # q, mod = divmod(a, b)
    # divmod(x, y) returns the tuple (x//y, x%y)
    # Higher-order function: reduce(operator.mul, xyz_count, 1)
    # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc127_f
    """

    """convenient decorator
    # @functools.lru_cache():
    # to facilitate use of recursive function
        # ex:
        # from functools import lru_cache
        # import sys
        # sys.setrecursionlimit(10**9)
        # @lru_cache(maxsize=None)
        # def fib(n):
        #     if n < 2:
        #         return n
        #     return fib(n-1) + fib(n-2)
        # print(fib(1000))
    """
    
    # import numpy as np
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product # https://docs.python.org/ja/3/library/itertools.html
    # accumulate() returns iterator! to get list: list(accumulate())
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  # prime factor
        b, e = 2, 0  # base, exponent
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        # TODO: How should I do when n - r is negative?
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict # https://docs.python.org/ja/3/library/collections.html#collections.deque
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest # https://docs.python.org/ja/3/library/heapq.html
    from copy import deepcopy, copy # https://docs.python.org/ja/3/library/copy.html
    import operator
    from operator import itemgetter
    # ex1: List.sort(key=itemgetter(1))
    # ex2: sorted(tuples, key=itemgetter(1,2))
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd # Deprecated since version 3.5: Use math.gcd() instead.
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    # first create factorial_list
    # fac_list = mod_factorial_list(n)
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) # Recursive function in python is slow!
    def modinv(a, p = MOD):
        # evaluate reciprocal using Fermat's little theorem:
        # a**(p-1) is identical to 1 (mod p) when a and p is coprime
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        # fac_list = modfactorial_list(100)
        # print(modcomb(100, 5, modfactorial_list(100)))
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    """ initialize variables and set inputs
    # initialize variables
        # to initialize list, use [0] * n
        # to initialize two dimentional array, use [[0] * N for _ in range(N)]
    # set inputs
        # open(0).read() is a convenient method:
        # ex) n, m, *x = map(int, open(0).read().split())
        #     min(x[::2]) - max(x[1::2])
        # ex2) *x, = map(int, open(0).read().split())
        #     don't forget to add comma after *x if only one variable is used
    # preprocessing
        # transpose = [x for x in zip(*data)]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [(1, 4, 7), (2, 5, 8), (3, 6, 9)]
        # flat = [flatten for inner in data for flatten in inner]
        # ex) [[1, 2, 3], [4, 5, 6], [7, 8, 9]] => [1, 2, 3, 4, 5, 6, 7, 8, 9]
    # calculate and output
        # output pattern
        # ex1) print(*l) => when l = [2, 5, 6], printed 2 5 6
    """

    # functions used
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    # single int: int(r())
    # single string: r()
    # single float: float(r())
    # line int: R()
    # line string: r().split()
    # line (str, int, int): [j if i == 0 else int(j) for i, j in enumerate(r().split())]
    # lines int: [R() for _ in range(n)]
    """

    if __name__ != '__main__':
        # for test
        sys.stdin = open('sample.txt')

    # ----------------------------------
    # main

    A, B = R()
    if B % A == 0:
        print(A+B)
    else:
        print(B-A)
    
    # end of main
    # ----------------------------------

    """memo: how to use defaultdict of list
    # initialize
    Dic = defaultdict(list)
    # append / extend
    Dic[x].append(y)
    # for
    for k, v in Dic.items():
    """

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
if a[1]%a[0]==0:
    print(a[0]+a[1])
else:
    print(a[1]-a[0])

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

amari = B % A
if amari == 0:
  print( A + B )
else:
  print( B - A )

Submission status: Accepted

Solution code:
a,b = map( int, input().split() )

if b % a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# input
A, B = map(int, input().split())

# solve
ans = A + B if B % A == 0 else B - A

# output
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A, B = map(int,input().split())
if B % A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if B % A == 0:
    print(A + B)
else:
    print(B - A)

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
print(a+b) if b%a == 0 else print(b-a)

Submission status: Accepted

Solution code:
A,B=list(map(int,input().split()))
if B%A==0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
def main():
    a, b = map(int, input().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b - a)


main()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if b % a == 0:
    out = a + b
else:
    out = b - a

print(out)

Submission status: Accepted

Solution code:
def resolve():
    a,b=map(int,input().split())
    if b%a==0:
        print(a+b)
    else:
        print(b-a)
resolve()

Submission status: Accepted

Solution code:
A,B=map(int, input().split())

if B % A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
a, b = map(int, input().split(' '))
print(a + b) if b % a == 0 else print(b - a)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

if B%A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
#print(a,b)

if b%a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
L = list(map(int, input().split()))

sub = L[1] % L[0]

if sub == 0:
    print(L[0]+L[1])
else:
    print(L[1]-L[0])

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if b % a ==0:
    print(b + a)
else:
    print(b - a)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())

if b%a==0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))

if a[1]%a[0]==0:
	print(a[0]+a[1])
else:
	print(a[1]-a[0])

Submission status: Accepted

Solution code:
A,B = map(int,input().split())
if B%A == 0:
    ans = A+B
else:
    ans = B-A
print(ans)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

if B%A == 0:
    print(A+B)
else:
    print(-A+B)

Submission status: Accepted

Solution code:
a,b=list(map(int,input().split()))
if b%a==0:
    print(b+a)
else:
    print(b-a)

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
#s = input()

if b%a == 0:
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
A, B = map(int, input().split()) # 横に2個

if B % A == 0:
    print(A + B)
else:
    print(B- A)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
print([y-x,x+y][y % x == 0] )

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))

if a[1]%a[0]==0:
  print(a[0]+a[1])
else:
  print(a[1]-a[0])

Submission status: Accepted

Solution code:
N,K = map(int, input().split())
if K % N == 0:
    print(K + N)
else:
    print(K - N)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
if b%a == 0:
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
print((A+B) if B%A==0 else(B-A))

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

if B%A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())	
if y%x == 0:
  print(int(y+x))
else:
  print(int(y-x))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if b % a:
  print(b - a)
else:
  print(a + b)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    A, B = map(int, input().split())

    if B % A == 0:
        print(A + B)
    else:
        print(B - A)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100000)
input=sys.stdin.readline
def intinput():return map(int,input().split())

a,b=intinput()
print(a+b if b%a==0 else b-a)

Submission status: Accepted

Solution code:
#ABC118-A
A,B = map(int,input().split())
if B % A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
a, b = map(int,input().split())
print(a + b) if b%a == 0 else print(b - a)

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
print(b + a if b % a == 0 else b - a)

Submission status: Accepted

Solution code:
a, b = list(map(int, input().split()))
if b%a==0:
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if B%A == 0:
  print(A + B)
else:
  print(B - A)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
print((A+B,B-A)[B%A!=0])

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

A, B = nl()
if B % A == 0:
    print(A+B)
else:
    print(B -A)

Submission status: Accepted

Solution code:
a = int()
b = int()

1 <= a <= b <=20

a,b=(int(x) for x in input().split())


if b % a == 0:
    print(a + b)
else :
    print(b - a)

Submission status: Accepted

Solution code:
a,b = (int(x) for x in input().split())

print(a + b if b % a == 0 else b - a)

Submission status: Accepted

Solution code:
A, B =map(int, input().split())
if B%A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
if B/A==B//A:
  print(A+B)
else:
  print(B-A)

Submission status: Accepted

Solution code:
n1, n2  = [int(i) for i in input().split()]

if n2 % n1 == 0:
    r3 = n1 + n2
else:
    r3 = n2 - n1

print(r3)

Submission status: Accepted

Solution code:
A,B = list(map(int,input().split()))
if B % A == 0:
    print(A + B)
else:
    print(B - A)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if b%a == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
if b%a ==0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if B % A == 0:
	print(A + B)
else:
	print(B - A)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if b%a == 0:
  print(a+b)
else:print(b-a)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

if (B%A==0):
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
A,B  = map(int,input().split())
if B%A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
A,B = map(int,input().split())

if B % A == 0:
  print(A+B)
else:
  print(B-A)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if (B % A == 0):
  print(A + B)
else:
  print(B - A)

Submission status: Accepted

Solution code:
B,A=list(map(int,input().split()))

which=A%B

if which==0:
    print(A+B)
else:
    print(A-B)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
 
if b%a == 0:
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
A,B = list(map(int,input().split(' ')))

#print(A,B)
if (B % A) ==0:
  print(A+B)
else:
  print(B-A)

Submission status: Accepted

Solution code:
A,B = map(int, input().split())

if B%A == 0:
    print(A + B)
else :
    print(B - A)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

if(B%A == 0):
    print(A+B)
else:
    print(B-A)