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

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 = 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:
val = input().split(" ")

if int(val[0]) == int(val[1]):
  print(int(val[0]) + int(val[1]))
elif int(val[0]) > int(val[1]):
  if int(val[0]) % int(val[1]) == 0:
    print(int(val[0]) + int(val[1]))
  else:
    print(int(val[1]) - int(val[0]))
elif int(val[0]) < int(val[1]):
  if int(val[1]) % int(val[0]) == 0:
    print(int(val[0]) + int(val[1]))
  else:
    print(int(val[1]) - int(val[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().rstrip().split(" "))
num = b / a
if num == int(num):
  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(x) for x in input().split()]

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

Submission status: Accepted

Solution code:
num = input()
num = num.split()
a = int(num[0])
b = int(num[1])
flag = 0

for i in range(b):
    j = i + 1
    if b % j == 0:
        if a == j:
            flag = 1
            print(a + b)
if flag == 0:
    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:
str = input().split()
a = int(str[0])
b = int(str[1])

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

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B = map(int, lines.pop(0).split(' '))
    if B%A == 0:
        print(A+B)
    else:
        print(B-A)


#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Accepted

Solution code:
A, B = [int(_) for _ in input().split()]
if B % A:
    print(B - A)
else:
    print(A + B)

Submission status: Accepted

Solution code:
a, b = list(map(int,input().split()))
if b/a - 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:
from sys import stdin

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

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

input = lambda: stdin.readline()
main()

Submission status: Accepted

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

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

a, b = stdin.readline().rstrip().split()
a, b = int(a), int(b)

for i in range(1, 21):
    if a * i > b:
        print(b - a)
        break

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

Submission status: Accepted

Solution code:
s = input()

str1, str2 = s.split()
num1 = int(str1)
num2 = int(str2)

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

Submission status: Accepted

Solution code:
a = input().split()

b = int(a[0])
c = int(a[1])

if c % b == 0:
  print(c + b)
else:
  print(c - 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().strip().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:
s = input()

num1 = int(s.split()[0])
num2 = int(s.split()[1])

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

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(x) for x in input().split()]

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

else:
    print(B-A)

Submission status: Accepted

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

def io_generator():
	while True:
		yield raw_input()

#+++++++++++++++++++

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

#++++++++++++++++++++

if __name__ == "__main__":
	io=io_generator()
	print main(io)

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

wari = b%a
if wari == 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:
    print(B-A)
else:
    print(A+B)

Submission status: Accepted

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

def func_a():
  argv = input().split(" ")
  A = int(argv[0]) if int(argv[0]) >= 1 else 0
  B = int(argv[1]) if int(argv[1]) <= 20 else 0

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


if __name__ == "__main__":
  func_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() ]

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 = [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 = input().strip().split(' ')
a, b = [int(a), int(b)]
ans = 0
if b % a == 0:
        ans = a + b
else:
        ans = b - a
print(ans)

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())
if (b % a):
    print(b-a)
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(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:
    c= a + b
    print(c)
else:
    d = b - a
    print(d)

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(x) for x in input().split())
if B%A == 0:
  print(A + B)
else:
  print(B-A)

Submission status: Accepted

Solution code:
#coding: utf-8

#A = int(input())
#B = int(input())
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 = map(int, input().split())

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

print(str(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def check(a, b):
    if (b % a) == 0:
        return a + b
    else:
        return b - a 

def main():
    [a, b] = [int (num) for num in input().split(" ")]
    print(check(a, b))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


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

def main():
    input_line = stdin.readline().rstrip()
    a, b = [int(num_string) for num_string in input_line.split(' ')]
    answer = a_minus_b_or_b_minus_a(a, b)
    print(answer)


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:
    c = a+b
else:
    c = b-a

print(c)

Submission status: Accepted

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

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

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 = 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:
""" AtCoder"""

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 -*-

def main():
    sp = [int(e) for e in input().split(" ")]
    a = sp[0]
    b = sp[1]
    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:
    print("{}".format(A+B))
else:
    print("{}".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 = list(map(int, input().split()))
if a[1] % a[0] == 0:
  b = a[0] + a[1]
if a[1] % a[0] != 0:
  b = a[1] - a[0]
print(b)

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 0<A<21 and 0<B<21:
    if B%A == 0:
        print(A+B)
    else:
        print(B-A)
else :
    print("error")

Submission status: Accepted

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

#print A,B

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

Submission status: Accepted

Solution code:
A, B = list(map(int, raw_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())

c = B % A
if c ==0:
    ans = A+B
else:
    ans = B-A

print(ans)

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:
num1,num2 = [int(_) for _ in input().split()]
for i in range(num2):
    if num2%(i+1) == 0:
        if i+1 == num1:
            ans = num2+num1
            break
        else:
            ans = num2-num1
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:
import sys
input_lines = sys.stdin.readline()
a,b = input_lines.split( )

a = int(a)
b = int(b)

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    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= (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())
def qA(A,B):
    if B % A == 0:
        print(B+A)
    else:
        print(B-A)
qA(A,B)

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

Submission status: Accepted

Solution code:
# coding=utf-8

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

Submission status: Accepted

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

Q = B/A

if Q.is_integer():
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
As,Bs=input().split()
A=int(As)
B=int(Bs)
C=B/A
Cx=round(C,0)
# print(type(C))
if Cx==C:
    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:
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

if __name__ == "__main__":
    A, B = [int(i) for i in input().split()]
    B_list = make_divisor_list(B)
    if A in B_list:
        print(A+B)
    elif A not in B_list:
        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())  
if B%A == 0:
  print(A + B)
else:
  print(B - A)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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 = 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 :
    c = a+b
else:
    c = b-a
print (c)

Submission status: Accepted

Solution code:
"""
https://atcoder.jp/contests/abc118/tasks/abc118_a
"""


def parse():
    A, B = list(map(int, input().split()))
    return A, B


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


if __name__ == '__main__':
    inputs = parse()
    solve(*inputs)

Submission status: Accepted

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

def f(a, b):
    if (b % a == 0):
        return a + b 
    else:
        return b - a 
print(f(a[0], a[1]))

Submission status: Accepted

Solution code:
i = list(map(int, input().split()))
A = i[0]
B = i[1]

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
S = s.split()
A = int(S[0])
B = int(S[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(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:
import numpy as np
from collections import defaultdict

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

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

Submission status: Accepted

Solution code:
L = list(map(int, input().split()))
A = L[0]
B = 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 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() -> None:
    x = [int(i) for i in input().split()]
    if x[1] % x[0] == 0:
        print(sum(x))
    else:
        print(x[1] - x[0])


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
if n[1]%n[0] == 0:
    print(n[0]+n[1])
else:
    print(n[1]-n[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:
#!/usr/bin/python
# -*- Coding: utf-8 -*-

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

if (b/a).is_integer():
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

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

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

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:
#!/usr/bin/python3

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 -*-
"""
Created on Sat Feb 16 21:06:50 2019

@author: yff20
"""

l = input().split()
a = int(l[0])
b = int(l[1])

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

Submission status: Accepted

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

def solve():
    A, B = map(int, input().split())
    if (B//A)*A == B:
        res = A+B
    else:
        res = B-A

    return str(res)
if __name__ == '__main__':
    print(solve())

Submission status: Accepted

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

@author: iwata
"""

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())
result = a + b if b % a == 0 else b - a
print(result)

Submission status: Accepted

Solution code:
A, B = input().split()
if (int(B) % int(A)) == 0:
    print(int(B) + int(A))
else:
    print(int(B) - int(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
stdin = sys.stdin
def li(): return map(int, stdin.readline().split())
a, b = tuple(li())
div, mod = divmod(b, a)
if mod == 0:
    print(a + b)
else:
    print(b - a)

Submission status: Accepted

Solution code:
import numpy as np

x = input().split()

a = int(x[0])
b = int(x[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:
(a, b) = map(int, input().split())
if 1 <= (b / a) and 0 == (b % a):
    print(a + b)
else:
    print(b - a)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())
if B % A == 0 and B >= A:
    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()]
n=0
for i in range(1,30):
    if b == a*i:
        n = n+1
if n ==0:
    print(b-a)
if n==1:
    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():
    ans1, ans2 = map(int, input().split())
    if ans2 % ans1 == 0:
        print(ans1 + ans2)
    else:
        print(ans2 - ans1)

solve()

Submission status: Accepted

Solution code:
a = input()
b = a.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:
A,B = [int(x) for x in input().split(' ')]

pp = B / float(A)
pp2 = int(pp) * A
if abs(pp2 - B) != 0:
  print(B-A)
else:
  print(A+B)

Submission status: Accepted

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

amari = B % A

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

Submission status: Accepted

Solution code:
A, B = input().strip().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:
    x=a+b
else:
    x=b-a

print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
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:
    s=b+a
else:
    s=b-a
# 出力
print(s)

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:
#!/usr/bin/env python3

a, b = map(int, input().strip().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:

def solve():
    A, B = [int(i) for i in input().split()]
    result = 0
    if B % A == 0:
        result = B + A
    else:
        result = B - A
    print(result)


if __name__ == '__main__':
    solve()

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:
#!/usr/bin/env python3
# -*- 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())
print(a + b if (b % a == 0) else b - a)

Submission status: Accepted

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

    if B % A == 0:
        result = A + B
    else:
        result = B - A

    print(result)


if __name__ == '__main__':
    main()

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 = [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())
result = 0;

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

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:
# -*- coding: utf-8 -*-

N, K = (int(i) for i in input().split())

if K%N == 0:
    print(N+K)
else:
    print(K-N)

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

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 = list(map(int, input().split()))
if a[1] % a[0] == 0:
    print(sum(a))
else:
    print(a[1]-a[0])

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


# いくつか入力
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=list(map(int, input().split()))
if b % a==0:
  ret=a+b
else:
  ret=b-a
print(ret)

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

i = 0
check = 0
while(B - A*i >= 0):
    if B - A*i == 0:
        check = 1
        break
    else:
        i += 1

if check == 1:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

def solve(l1):

    l = [int(e) for e in l1.split(" ")]
    a = l[0]
    b = l[1]

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


    return str(result)

def main():
    # 出力
    params = []
    for i in range(0, 1):
        params.append(input())   
    print(solve(*params))

if __name__ == '__main__':

    main()

Submission status: Accepted

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

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)