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, raw_input().split())
if B % A == 0:
    ans = A + B
else:
    ans = B - A

print str(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:
#!/usr/bin/env python3
import sys


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


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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=map(int,input().split())
print(a+b if a%b==0 or b%a==0 else abs(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 abc():
    a, b = map(int, input().rstrip().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b -a)


abc()

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 == 0 else B - A)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

else:
    print(B - A)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
inp = input().split()
a = int(inp[0])
b = int(inp[1])

if b/a == math.floor(b/a):
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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())
print(A+B if B%A==0 else B-A)

Submission status: Accepted

Solution code:
input_line = input()
A,B = [int(s) for s in input_line.split(' ') if s]

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

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

Submission status: Accepted

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

if(B%A == 0 and 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:
#!/usr/bin/python
# 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())
ans = B - A
if B % A == 0:
    ans = A + B
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:
L=list(map(int,input().split()))
if L[1]%L[0]==0:
  print(L[0]+L[1])
else:
  print(L[1]-L[0])

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
if b % a == 0:
    print(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())
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(v) for v in input().split() ]

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
input = sys.stdin.readline

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

Submission status: Accepted

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

lst_1 = input().split()

A = int(lst_1[0])
B = int(lst_1[1])

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def sub():
    A, B = [int(e) for e in input().split()]
    q, m = divmod(B, A)
    if q > 0 and m == 0:
        print(A+B)
    else:
        print(B-A)

sub()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# スペース区切りの整数の入力
A,B = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(ab) for ab in input().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:
        print(A+B)
    else:
        print(B-A)


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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 = 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(int(b+a))
else:
  print(int(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:
*l, = map(int, open(0).read().split())
if l[1] % l[0] == 0:
	print(l[0] + l[1])
else:
	print(l[1] - l[0])

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
sp = stdin.readline().split()
A, B = int(sp[0]), int(sp[1])

def div(num):
    l = []
    for itr in range(1,num+1):
        if num % itr == 0:
            l.append(itr)
    return l

B_divisor = div(B)
if A in B_divisor:
    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())

calc = b % a

if calc == 0:
    output = a + b
else :
    output = b - a

print(output)

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:
first = input()
(sA, sB, ) = first.split()
A = int(sA)
B = int(sB)
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:
import sys


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

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int,input().split())
mod=B%A
if mod==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:
import sys
input = sys.stdin.readline

N, M = map(int, input().split())

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

Submission status: Accepted

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

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

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


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    print(str(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:
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:
a,b = (int(j) for j 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(b+a) 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:
#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())
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= list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

if B%A == 0:
    print '{}'.format(A+B)
else: # B%A != 0
    print '{}'.format(B-A)

Submission status: Accepted

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

m=b/a

if m-int(m) == 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 python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(A: int, B: int):
    return (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
    result = solve(A, B)
    print(result)

if __name__ == '__main__':
    main()

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 == 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:
x, y = map(int, input().split())

print([y-x, x+y][y % x == 0])

Submission status: Accepted

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

Submission status: Accepted

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

N = input().split()
N_map = map(int,N)

N_list = [x for x in N_map]
a = N_list[0]
b = N_list[1]

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

else:
    print(b-a)

Submission status: Accepted

Solution code:
ab = input().split()
a = int(ab[0])
b = int(ab[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())
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):
    C = A + B
else:
    C = B - A
print(C)

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(c) for c 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())
b = []
for i in range(1,21):
    if B % i == 0:
        b.append(i)
if A in b:
    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:
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 not B % A:
    print(A + B)
else:
    print(B - A)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper

a, b = inl()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC118A - B +/- A
a, b = list(map(int, input().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

    ans = solve(a, b)
    print(ans)


main()

Submission status: Accepted

Solution code:
#!/usr/bin/python

def main():
    A, B = [int(x) for x in input().split()]
    if divisor(A, B) == True:
        print(A + B)
    else:
        print(B - A)

def divisor(A, B):
    if B % A == 0: return True 
    return False


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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