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

a = i[0]
b = i[1]

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

Submission status: Accepted

Solution code:
import sys

v = []
for line in sys.stdin:
  v = [int(l) for l in line.split()]

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

Submission status: Accepted

Solution code:
# 2019/02/09
# AtCoder Beginner Contest 118 - A

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

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

# Output
print(ans)

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

Submission status: Accepted

Solution code:
import os, sys 

s = input()

A, B = map(int, s.split(' '))

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# Author:   Noname
# URL:      https://github.com/pettan0818
# License:  MIT License
# Created: 金  2/22 10:17:52 2019

# Usage
#
"""
def s(a, b):
    """
    >>> s(1,2)
    3
    >>> s(1,1)
    2
    >>> s(8,20)
    12
    >>> s(4,12)
    16
    """
    if b % a == 0:
        print(a+b)
    else:
        print(b-a)
        
def i():
  return [int(i) for i in input().split()]


if __name__ == '__main__':
  s(*i())

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(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())
print([b+a,b-a][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 = [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, 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:
ENT = list(map(int, input().split()))
A = ENT[0]
B = ENT[1]

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

Submission status: Accepted

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

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:
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 a > b:
	a, b = b, a

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:
def solve():
    x,y = [int(i) for i in input().split()]
    if(y % x == 0):
        print(x + y)
    else:
        print(y - x)
        



solve()

Submission status: Accepted

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

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

else:
	print b - a

Submission status: Accepted

Solution code:
AB = input()


mapped_AB  = map(int, AB.split())
#A = list(mapped_AB)[0]
#B = list(mapped_AB)[1]
listed_AB = list(mapped_AB)
A = listed_AB[0]
B = listed_AB[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 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())
if b%a==0:
    print(str(a+b))
else:
    print(str(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:
input_int = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
x,y=list(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())

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

print(K)

Submission status: Accepted

Solution code:
import sys
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())
count=0
for i in range(1,b+1,1):
    if b%i==0:
        if i==a:
            count+=1

if count==1:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

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

c = b -  a

ahi = False

for i in range(a):
    if b % a == 0:
        ahi = True

if ahi:
    c = a + b

print(c)

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians, log10
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul, xor
from copy import copy, deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B = MAP()

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

Submission status: Accepted

Solution code:
list1 = [int(a) for a in input().split()]
list1_0 = list1[0] #A
list1_1 = list1[1] #B

if (list1_1 % list1_0) == 0:
    print(list1_0 + list1_1)
else:
    print(list1_1 - list1_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
a,b = map(int, input().split())
if b % a == 0:
    print(b + a)
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:

if __name__ == "__main__":
    a, b = map(int, raw_input().split(" "))
    if b % a:
        print(str(b - a))
    else:
        print(str(a + b))

Submission status: Accepted

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

if x-y>0:
  A=x
  B=y
else:
  A=y
  B=x

if A%B==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(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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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


if __name__ == '__main__':
    print(solve(input()))

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:
print((lambda a,b: b-a if b%a else a+b)(*[int(i) for i in input().split()]))

Submission status: Accepted

Solution code:
import sys

c = sys.stdin.readline().split()
A = int(c[0])
B = int(c[1])
if B % A == 0:
    print(str(B + A))
else:
    print(str(B - A))

Submission status: Accepted

Solution code:
[print(b-(-1)**(b%a==0)*a)for a,b in [[int(i) for i in input().split()]]]

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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())
c=b/a
if c.is_integer()==True:
    print(b+a)
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:
    print(a + b)
else:
    print(b-a)

Submission status: Accepted

Solution code:

x = list(map(int,input().strip().split()))

a = x[0]
b = x[1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
	a, b = [int(x) for x in input().split(' ')]
	# a, b = 1, 1
	if b % a == 0:
		print(a + b)
	else:
		print(b - a)

if __name__ == '__main__':
	main()


# If 
# A
#  is a divisor of 
# B
# , print 
# A
# +
# B
# ; otherwise, 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:
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 = map(int,input().split())
print(a + b if b%a == 0 else b - a)

Submission status: Accepted

Solution code:
tmp_a,tmp_b = input().split()
tmp_a = int(tmp_a)
tmp_b = int(tmp_b)

n = tmp_b//tmp_a
tmp = False
for idx in range(n+1):
    if tmp_b == tmp_a * idx:
        tmp = True

if tmp == True:
    ans = tmp_a + tmp_b
else:
    ans = tmp_b - tmp_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:
# your code goes here

def main(A, B):
	
	if B%A == 0:
		return A+B
	else:
		return B-A


stdin = input().split(' ')
stdin = [ int(c) for c in stdin]
print(main(stdin[0], stdin[1]))

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  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())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
# import numpy as np

s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()


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

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

Submission status: Accepted

Solution code:
a,b=(float(i) for i in input().split())
if (b/a).is_integer():
    print(int(a+b))
else:
    print(int(b-a))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


a, b = inpl()

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:

# coding: utf-8

# In[7]:


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


# In[8]:


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

Submission status: Accepted

Solution code:
from sys import stdin

A,B = [int(x) for x in stdin.readline().strip().split()]
if not B % A:
    print(A+B)
else:
    print(B-A)

Submission status: Accepted

Solution code:
from sys import stdin

# input
a, b = [int(x) for x in stdin.readline().rstrip().split()]

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

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 = list(map(int,input().split()))
A,B= a[0],a[1]
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: print(b-a)
else: print(a+b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def get_int(): return int(input())
def get_float(): return float(input())
def get_line(): return input().split()
def get_lines(v): return [get_line() for _ in range(v)]
def get_int_line(): return list(map(int, get_line()))
def get_int_lines(v): return [get_int_line() for _ in range(v)]
def get_float_line(): return list(map(float, get_line()))
def get_float_lines(v): return [get_float_line() for _ in range(v)]

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a,b = LI()
    if b % a == 0:
        return a + b

    return b - a



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

Submission status: Accepted

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

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:
#abc118a

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 = [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:
# -*- 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:
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 = (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().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().strip().split())
if ( b% a == 0):
  print ( a+b)
else:
  print(b-a)

Submission status: Accepted

Solution code:
#!/usr/bin/env python


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print([b - a, 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)
elif b % a != 0:
    print(b - a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


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


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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:
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())
print(A+B) if B % A == 0 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:
# -*- coding: utf-8 -*-


def isDivisor(target, n):
    return n % target == 0


# スペース区切りの整数の入力
a, b = map(int, input().split())

if isDivisor(a, b):
    output = a + b
else:
    output = b - a

print("{}".format(output))

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:
if __name__ == '__main__':
    a, b = map(int, input().split())
    if b % a:
        print(b - a)
    else:
        print(a + b)

Submission status: Accepted

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


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

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

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

print(R)

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=[int(i) for i in input().split()];print([a+b,b-a][b%a!=0])

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 = [int(i) for i in input().split()]
print([a+b,b-a][b%a!=0])

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


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

Submission status: Accepted

Solution code:
# 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())
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:
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())
print([a+b,b-a][b%a>0])

Submission status: Accepted

Solution code:
number = input().split()
a = int(number[0])
b = int(number[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:
inp = input().split(' ')

A = int(inp[0])
B = int(inp[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,b-a][b % a != 0])

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest118-A
#  TODO https://atcoder.jp/contests/abc118/tasks/abc118_a

def solveProblem(Seme,Uke):
	amari = Uke % Seme
	if amari == 0:
		answer = Uke + Seme
	else:
		answer = Uke - Seme
	return answer


if __name__ == '__main__':
	A,B = map(int,input().strip().split(' '))
	solution = solveProblem(A,B)
	print("{}".format(solution))

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:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


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

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


if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inputData = input().split(' ')
ans = 0

if int(inputData[1]) % int(inputData[0]) ==0:
    ans = int(inputData[0]) + int(inputData[1])
else:
    ans = int(inputData[1]) - int(inputData[0])
print(ans)