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:
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().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) != 0:
    print(b-a)
else:
    print(a+b)

Submission status: Accepted

Solution code:
(A, B) = (int(i) for i in 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 = 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(a + b if b % a == 0 else b -a)

Submission status: Accepted

Solution code:
a, b = map(int, raw_input().split())
c = b/a
if c*a == b:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000)
input = sys.stdin.readline

def chkprint(a):
	a_name = ''
	for k, v in globals().items():
		if id(v) == id(a):
			a_name = k
			break
	print(a_name+' = '+str(a), file=sys.stderr)

def mt(f):
	import time
	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		print(e - s, 'sec', file=sys.stderr)
		return ret
	return wrap

A, B = [int(i) for i in input().split()]
if B // A == B / A:
	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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on 2019/2/16
Solved on 2019/2/16
@author: shinjisu
"""


# ABC 118
def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


def dmp(x):
    global debug
    if debug:
        print(x)
    return x


def probA():
    A, B = getIntList()
    dmp((A, B))
    if B % A == 0:
        return A+B
    else:
        return B-A


debug = False  # True False
print(probA())


def probB():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    return 123


def probC():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    return 123


def probD():
    N = getInt()
    A = getIntList()
    dmp((N, A))
    return 123

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:
import sys
# import bisect
# import math
# import numpy as np


"""Template"""


class IP:
    """
    入力を取得するクラス
    """
    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        # 参考
        # https://blog.rossywhite.com/2018/08/06/bit-search/
        # https://atcoder.jp/contests/abc105/submissions/4088632
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    # output.append(a[j])
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x//y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def d(self, p):
        re = 0
        for i in range(len(p) - 1):
            re += ((p[i][0] - p[i + 1][0]) ** 2 + (p[i][1] - p[i + 1][1]) ** 2) ** 0.5
        return re


"""ここからメインコード"""


def main():
    # 1文字に省略
    r, e = range, enumerate
    ip = IP()
    id = Idea()

    """この下から書いてね"""
    a, b = ip.IL()
    
    if b % a == 0:
        print(a + b)
    else:
        print(b - a)
main()

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(B - A)
else:
  print(A+B)

Submission status: Accepted

Solution code:
i = input().rstrip().split(" ")
a = int(i[0])
b = int(i[1])
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 = list(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:
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:
#-*- coding: utf-8 -*-
"""
https://yahoo-procon2019-qual.contest.atcoder.jp/tasks/yahoo_procon2019_qual_a
"""


def sol(a, b):
    if b % a == 0: return a+b
    else: return b-a


test = False
#test = True
if test:
    n, k = 4, 12
    #S =list( map(int, "1 6 3".split()))
    print(sol(n, k))

    n, k = 8, 20
    #S =list( map(int, "7 4 0 3".split()))
    print(sol(n, k))
    #
    n, k = 31, 10
    #S =list( map(int, "1000000000000".split()))
    print(sol(n, k))

    n, k = 10, 90
    #S =list( map(int, "1000000000000".split()))
    print(sol(n, k))

else:
    a, b = map(int, input().split())
    #S =list( map(int, input().split()))
    print(sol(a, b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b =(int(i) for i 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(B + A)
else:
  print(B - A)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 20:52:15 2019

@author: Owner
"""


import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter
import itertools
import copy

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())
    
all(nstr.count(c) for c in '753')

ABT = zip(A, B, totAB)
result = 0
# itemgetterには何番目の配列をキーにしたいか渡します
sorted(ABT,key=itemgetter(2))
#A, B, totAB = zip(*ABT)
(x >> i) & 1

"""


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:
    x = A+B
else:
    x = B-A
print(x)

Submission status: Accepted

Solution code:
import fileinput


def algorithm(a, b):
    return a + b if b % a == 0 else b - a


def pass_inputs(input_lines):
    a, b = input_lines[0]
    return algorithm(a, b)


def convert_int(s):
    try:
        r = int(s)
    except ValueError:
        r = s
    return r


def run():
    out = pass_inputs([[convert_int(v) for v in l.strip().split(" ")] for l in fileinput.input()])
    print(out)


if __name__ == "__main__":
    run()

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())

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

Submission status: Accepted

Solution code:
a=input()
A=int(a.split()[0])
B=int(a.split()[1])

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

Submission status: Accepted

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

if not B%A:
	print A+B
else:
	print B-A

Submission status: Accepted

Solution code:
### A

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:

a,b= map(int,input().split())

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

Submission status: Accepted

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

if b % a == 0:
  print("{}".format(a+b))
else:
  print("{}".format(b-a))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, m = map(int,input().split())
if m%n == 0:
    print(n+m)
else:
    print(m-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())
if B % A == 0:
  print(int(A+B))
else:
  print(int(B-A))

Submission status: Accepted

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


    return 0

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 ==  0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

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

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:
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 = [int(_) for _ in input().split()]
print(a + b if b % a == 0 else b - a)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
import math
import bisect
import random
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return list(input())
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007

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

#C
"""
def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a,a)
n = II()
a = LI()
ans = a[0]
for i in range(1,n):
    ans = gcd(ans,a[i])
print(ans)
"""

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

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(str(a+b))
else:
    print(str(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:
Tmp = []
Tmp = input().rstrip().split(' ')

nA = int(Tmp[0])
nB = int(Tmp[1])

nTmp = nB % nA

if nTmp==0:
	print(nA+nB)
else:
	print(nB-nA)

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:
x, y = [int(i) for i in input().split()]

if y%x == 0:
    print(x+y)
else:
    print(y-x)

Submission status: Accepted

Solution code:
A,B=map(int, raw_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(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 == 0:
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
#ABC118A-A-B+/-.py

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:
# N = int(input())
A,B = list(map(int,input().split()))
#for i in range(N):
#  x,y = list(map(int,input().split()))
#  l.append([x,y])

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

Submission status: Accepted

Solution code:
A, B = map(int, raw_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)
elif b % a != 0:
    print(b - a)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=b//a
if c*a==b:
    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

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 = 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:
	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(i) for i in input().split())
print(a+b if b%a==0 else b-a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest 118：A - B +- A


def main():
    A, B = [int(i) for i in raw_input().strip().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) * a == b:
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
A,B=input().split()
A=int(A)
B=int(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)

Submission status: Accepted

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

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=[]#入力画面の二文字を別々の文字に格納
a=input().split(" ")
A=int(a[0])
B=int(a[1])

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:
        ans = B + A
    else:
        ans = B - A

    print(ans)


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:
import sys

def main(inp):
    a,b=map(int,next(inp).split())
    if(b%a==0):
        return a+b
    else: return b-a
    
print(main(sys.stdin))

Submission status: Accepted

Solution code:
from sys import stdin

a, b = list(map(int, stdin.readline().rstrip().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 = [int(i) for i 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 == 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:
#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:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor

import heapq
import itertools
import operator


def get_int():
    return int(input())


def get_str():
    return input().strip()


def get_int_list():
    return [int(i) for i in input().split()]


def get_char_list():
    return list(input().strip())


def main():
    a, b = get_int_list()
    if b % a == 0:
        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 = (int(i) for i in input().split())
if((B%A)==0):
    print(int(A+B))

else:
    print(int(B-A))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a, b = map(int, raw_input().split())

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

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
for i in range(21):
    if A*i == B:
        print(A+B)
        break
else:
    print(B-A)

Submission status: Accepted

Solution code:
n, m = map(int,input().split())

if( m % n == 0 ):
    print(m+n)
else:
    print(m-n)

Submission status: Accepted

Solution code:
A,B=[int(_) for  _ in 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:
A,B = [int(_) for _ in input().split()]
if B%A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
A,B = map(int, input().split())
ans = 0
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(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:
import sys
input = sys.stdin.readline
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(b+a)
else:
    print(b-a)

Submission status: Accepted

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

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:
from sys import stdin
A,B=[int(x) for x in stdin.readline().rstrip().split()]
if B%A==0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
a, b = map(int, raw_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().rstrip().split())

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

Submission status: Accepted

Solution code:
a, b = [int(i) for i 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 = map(int, input().split())

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

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 = [int(i) for i in 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:
A, B = [int(n) for n in input().split()]

answer = ""
if B % A == 0:
    answer = A + B
else:
    answer = B - A

print(answer)

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)


main()

Submission status: Accepted

Solution code:
import sys
from operator import itemgetter


def r(a, b):
    if b % a == 0:
        return a + b
    else:
        return b - a


def main():
    input = sys.stdin.readline
    a, b = list(map(int, input().split()))

    print(r(a, b))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
import copy
import bisect







def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input().split())



def func():
    if n[1]%n[0]==0:
        return sum(n)
    return n[1]-n[0]


print(func())

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:
import math
import sys
import random
from operator import itemgetter
input = sys.stdin.readline

# a = int(input().rstrip())
# a, b = map(int, input().rstrip().split())
# D = list(map(int, input().rstrip().split()))
# H = [int(input().rstrip()) for _ in range(L)]
# DD = [[0 for j in range(100)] for i in range(200)]
# dict = {} ## dictionary

# a = sorted(a, key=lambda x: x[1]))
# if __name__ == '__main__':


a, b = map(int, input().rstrip().split())

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

Submission status: Accepted

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

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 = 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:
# -*- coding: utf-8 -*-
A, B = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:


nums = [int(num) for num in input().split()]
if nums[1] % nums[0] == 0:
    print(nums[0] + nums[1])
else:
    print(nums[1]-nums[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())

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:
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    a, b = il()
    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())
if B % A == 0:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
a, b = [int(i) for i 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 = list(map(int, input().split()))
if b%a ==0:
  print(a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
a, b = [int(s) for s in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = (int(i) for i in input().split()) 

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

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())

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

Submission status: Accepted

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


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)