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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b = map(int, open(0).read().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 = map(int, input().split())
print(A + B if B / A == int(B / A) else B - A)

Submission status: Accepted

Solution code:
#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
a,b=map(int,input().split())
if b%a==0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = b % a

if x ==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


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


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

Submission status: Accepted

Solution code:
import sys
A, B = map(int, sys.stdin.readline().rstrip().split())
if B % A == 0:
    print(A + B)
else:
    print(B - A)

Submission status: Accepted

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

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

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(A, B))

def test():
    import doctest
    doctest.testmod()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(str) for str in input().strip().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 B-A)

Submission status: Accepted

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

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 yakusu(n):
    a = []
    for i in range(1, int(n*0.5)+1):
        if n % i == 0:
            a.append(i)
    a.append(n)
    return a

A, B = map(int, input().split())
b = yakusu(B)
if A in b:
    print(A + B)
else:
    print(B - A)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
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(x+y)
else:
    print(y-x)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy
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())
s = B%A
if s ==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()))
if b % a == 0:
    print(a + b)
else:
    print(b - a)

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

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

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


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( A+B ) if B % A == 0 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

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    a, b = mi()
    print(a+b) if b % a == 0 else print(b-a)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18
# ----------------------------------------------------------- #

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

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

#############
# Main Code #
#############

A,B = inputIL()

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 not B % A else B - A)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

A,B=MI()

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

Submission status: Accepted

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

if __name__ == '__main__':

    ABC_118_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
import sys
try:
    from typing import List
except ImportError:
    pass


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


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:
import itertools
import math

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

Submission status: Accepted

Solution code:
A, B = list(map(int, input().split()))
print(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:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
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, 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,a+b][b%a<1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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=[int(x) for x in 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:
ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########
def main(a,b):
    return a + b if b % a == 0 else b - a

a,b = mi()
print(main(a,b))

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:
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 -*-
"""
Created on Mon May  4 20:55:48 2020
"""

import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

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

Submission status: Accepted

Solution code:
#/usr/bin/env python3

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

Submission status: Accepted

Solution code:
# A - B +/- 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 = [int(x) for x in input().split()]
print([a + b, b - a][int(bool(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 a == b:
    print(a + b)
elif 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
a, b = map(int, input().split())
print(a + b) if b % a == 0 else print(b - a)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


def solve():

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
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())
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 == 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:
import sys
input = sys.stdin.readline

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

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=[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())

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

Submission status: Accepted

Solution code:
def aplusb(a, b):

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

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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
bl = B % A == 0
print(A + B if bl 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 = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import math
A,B=map(int, input().split())
print (B+A-2*A*math.ceil(B%A/20))

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

Submission status: Accepted

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