Problem:


Score : 100 points

Problem Statement

You are given positive integers A and B.

If A is a divisor of B, print A + B; otherwise, print B - A.

Constraints

All values in input are integers.

1 \leq A \leq B \leq 20

Input

Input is given from Standard Input in the following format:

A B

Output

If A is a divisor of B, print A + B; otherwise, print B - A.

Sample Input 1

4 12

Sample Output 1

16

As 4 is a divisor of 12, 4 + 12 = 16 should be printed.

Sample Input 2

8 20

Sample Output 2

12

Sample Input 3

1 1

Sample Output 3

2

1 is a divisor of 1.



Sample input:
4 12


Sample output:
16

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b=INTM()
    if b%a==0:
        print(a+b)
    else:
        print(b-a)
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

A, B = list(map(int, sys.stdin.buffer.readline().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def print_ans(A, B):
    """Test Case
    >>> print_ans(4, 12)
    16
    >>> print_ans(8, 20)
    12
    >>> print_ans(1, 1)
    2
    """
    if B % A == 0:
        print(A + B)
    else:
        print(B-A)

if __name__ == '__main__':
    A, B = map(int, input().rstrip().split())
    print_ans(A, B)

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())
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 = list(map(int, input().split()))
if (B / A) - int(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).is_integer():
  print(B + A)
else:
  print(B - A)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def p_a():
    a, b = map(int, input().split())
    print(a + b if b % a == 0 else b - a)
    
p_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:
  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:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B=map(int, input().split())  #複数数値入力　「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:
# ABC118a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

Submission status: Accepted

Solution code:
A,B=tuple(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 math

#入力
#S = str(input())
#N, i = map(int, input().split())
#K = 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 b - a)

Submission status: Accepted

Solution code:
import os, sys, re, math

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os, sys, re, math

(A, B) = [int(n) for n in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if 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 = (int(i) for i in 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(b-a if b%a else b+a)

Submission status: Accepted

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

for i in range(21):
    if a*i == b:
        print(a+b)
        exit()
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:
#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 = 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 int(b/a) == b/a:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

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

if data[1]%data[0] == 0:
    print(sum(data))
else:
    print(data[1]-data[0])

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

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 == 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:
# 2019-11-12 15:53:47(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    a, b = (int(x) for x in sys.stdin.readline().split())
    print(a + b if b % a == 0 else b - a)



if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(ret)

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

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

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:
#  ABC 118: A – B +/- A
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:
    print(b-a)
else:
    print(a+b)

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
# = int(input())
# = input()
# = 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-2*a*(b%a>0))

Submission status: Accepted

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

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

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

input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

a, b = mi()
if b / a % 1 == 0:
    print(a+b)
else:
    print(b-a)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC118A - B +/- A
def main():
    A, B = map(int, input().split())
    flg = B % A
    print(B - A if flg else A + B)


if __name__ == "__main__":
    main()

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:
from sys import stdin
 
A,B = map(int,stdin.readline().strip().split())

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

print(ans)

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A , B = map(int,input().split())
x = B / A
if x.is_integer():
    print(A + B)
else:
    print(B - A)

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    print(a + b if b % a == 0 else b - a)


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#2019/10/10
A, B = map(int, open(0).read().split())
print(A+B if B%A==0 else 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 print(b-a)

Submission status: Accepted

Solution code:
a,b=(int(x) for x in 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())


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''A - B +/- A
https://atcoder.jp/contests/abc118/tasks/abc118_a

>>> main(4, 12)
16
>>> main(8, 20)
12
>>> main(1, 1)
2
'''


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


if __name__ == "__main__":
    a, b = map(int, input().split(' '))
    main(a, b)

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    a, b = list(map(int, input().rstrip('\n').split()))
    if b % a == 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0

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

print ans

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    print(B - A)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

Submission status: Accepted

Solution code:
#118a
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:
#!/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:
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 if B%A!=0else 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,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 == B / A:
  print(B+A)
  exit()
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())
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:
  print(B - A)
else:
  print(A + B)

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:
s=list(input().split())
a=int(s[0])
b=int(s[1])

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = 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());print([a+b,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 = 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:
    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:
    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 == 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())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

calc = b%a
if calc == 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:
A, B = input().split()

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