TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
import sys
import pprint

pp = pprint.PrettyPrinter(indent=4)

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

if __name__ == '__main__':
    main()


import sys
import pprint

pp = pprint.PrettyPrinter(indent=4)

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

if __name__ == '__main__':
    main()


import sys
import pprint

pp = pprint.PrettyPrinter(indent=4)
rl = lambda: sys.stdin.readline().strip()

def main():
    """ Code implementation """
    a, b = rl().split()
    if int(b) % int(a) == 0:
	print(int(a) + int(b))
    else:
	print(int(b)-int(a))

if __name__ == '__main__':
    main()


import sys
import pprint

pp = pprint.PrettyPrinter(indent=4)

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

if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):

N,M = map(int, input().split())
A_list=[]
food_list=[]

for i in range(N):
  A_list.append([int(e) for e in input().split()])

for i in range(M):
  food_list.append(0)
  
for i in range(N):
  K=A_list[i][0]
  for j in range(1,K+1):
    #print(A_list[i][j],end="")
    food_list[A_list[i][j]-1]+=1

ans=0
    
for i in range(M):
  if food_list[i]==N:
    ans+=1
    
print(ans)


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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A,B = mao (int, input ().split ())
if B%A == 0:
  print (A+B)
else:
  print (B-A)

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b = map(int,input().split())

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

t, x = map(int,input().split())

print(t / x)

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a = int()
b = int()

1 <= a <= b <=20

a,b=(int(x) for x in input().split())


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


1 <= a <= b <=20

a,b=(int(x) for x in input().split())


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


a = int()
b = int()

1 <= a <= b <=20

a,b=(int(x) for x in input().split())


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


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A, B = map(int, input().split(" "))

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
N, M = map( int, input().split() )
A = list( map( int, input().split() ) )



dp = [0]*(N+1)       
cost = [ 0, 2, 5, 5, 4, 5, 6, 3, 7, 6 ]  

for num_match in range( 2, N+1 ):
    for Aj in A:
        if num_match >= cost[Aj]:
            dp[num_match] = max( dp[num_match], dp[num_match-cost[Aj]]+1 )



ans = ""
digit = dp[N]

A.sort( reverse=True )
while N > 0:
    for Ai in A:
        if N-cost[Ai] >=0 and dp[N-cost[Ai]] == digit-1:
            ans += str(Ai)
            N -= cost[Ai]
            digit -= 1
            break

print( ans )

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A, B = map(int, input().split())

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b=int(input())
if b%a==0:
  print(a+b)
else:
  print(b-a)

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
from collections import Counter

N, M=map(int, input().split())
a = []
for i in range(N):
  b = []
  b = list(map(int, input().split()))
  del b[0]
  a.extend(b)
  
c=Counter(a)
    
freq_scores = c.most_common()
    
max_count = freq_scores[0][1]

modes = []
    　
for num in freq_scores:
	if num[1] == max_count:
    	modes.append(num[0])

print(len(a[modes]))


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

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


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
from sys import stdin
import sys
N,M = map(int,stdin.readline().rstrip().split())
if N == 0:
    print(1)
    sys.exit()
list = [ set(stdin.readline().rstrip().split()[1:]) for _ in range(0,N)]
print(list)
fav = list[0]
for i in range(1,N):
    fav = fav.intersection(list[i])
print(len(fav))

# 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) 

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b  map(int, input().split())
if b // a == b / a:
  print(a+b)
else:
  print(a-b)

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
def inpl(): return list(map(int, input().split()))

MLE = [[0]*10000 for _ in [0]*10000]

A, B = inpl()
print([A+B, B-A][B%A > 0])
    

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

A, B = inpl()
print([A+B, B-A][B%A > 0])
    

Verdicts: Time Limit Exceeded

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a=list(map(int,input().sprit()))
if a[1]%a[0]==0:
    print(a[0]+a[1])
else:
    print(a[1]-a[0])

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A,B = input().split()
if B%A == 0:
  print(A + B)
else:
  print(A - B)

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b = map(int, input().split())

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A = int(input())
B = int(input())
if B % A == 0:
  print(A + B)
else:
  print(A - B)

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
N = int(input())
A = input().split(" ")
A = [int(i) for i in A]
list = [min(A)]
A = sorted(A)
iii = 0
while True:
    iii += 1
    if A[N-1] % A[N-2] != 0:
        A[N-1] = A[N-1] % A[N-2]
    elif N >= 3 and A[N-1] % A[N-3] != 0:
        A[N-1] = A[N-1] % A[N-3]

    A = sorted(A)
    list.append(min(A))
    if iii > 32:
        break       
#print(list)
for i in range(N-1):
    if A[i+1]-A[i] > 0:
        list.append(A[i+1]-A[i])
#print(list)
print(min(list))

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
import numpy as np
N, M = map(int, input().split())
a = np.zeros((N,M))
for i in range(N):
    K = list(map(int, input().split())) 
    for j in K[1:]:
        a[i][j-1] = 1
b = a.sum(axis=0)
print(len(np.where(b==N)[0]))

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A, B=map(int, input().split())

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

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b=map(int,input().sulit())
if(b%a==0):
  print(a+b)
else:
  print(b-a)
  

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b = [ int(v) for v in input().split() ]

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

a, b = [ int(v) for v in input().split() ]

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

a, b = [ int(v) for v in input().split() ]

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a = int(input())
b = int(input())
print(a+b if b%a == 0 else a-b)

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
ab=input().split()
a=int(ab[0])
b=int(ab[1])
if isinstance(b/a,int):
  print(str(a+b))
else:
  print(str(b-a))

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

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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A,B = int(input().split())
if(B % A == 0):
  print(A + B)
else:
  print(B - A)


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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
inputString = input('Enter a string:')
#inputString = "4 12"
nums = []
for num in inputString.split(" "):
    nums.append(int(num))

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

inputString = input('Enter a string:')
#inputString = "4 12"
nums = []
for num in inputString.split(" "):
    nums.append(int(num))

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

def gcd(a,b):
    r = a%b
    #print(a,b,r)
    if(r==0): return b
    return gcd(b,r)
n = int(input()) 
#n=4
hps = [int(i) for i in input().split()]
#lst = [2, 2, 8, 40]
#lst = [5, 13, 8, 1000000000]
#lst = [0, 1, 0]
    ##2 4 5 -> 1
    
hps = sorted(hps)
for i in range(1,n):
    hps[0] = gcd(hps[i], hps[0])
print(hps)
for i in range(len(hps)):
    if(hps[i]==0): continue
    print(hps[i])
    break

import numpy as np
n = int(input()) 
#n=4
lst = [int(i) for i in input().split()]
#lst = [2, 2, 8, 40]
#lst = [5, 13, 8, 1000000000]
#lst = [0, 1, 0]
hps = np.array(lst)
while(1):
    hps = sorted(hps)
    #print(hps)
    if(hps[0]==0): break
    if(hps[0]==hps[len(hps)-1]): break
    hps[1] = hps[1] - hps[0]
print(hps[1])

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

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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
import sys

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

import sys

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A,B=int(input())
if B%A==0:
  ptint(A+B)
else:
  print(B-A)

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

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


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

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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b = map(int,input().split(" "))

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

else:
  print(b-a)

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

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

else:
  print(b-a)

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A,B = map(int,input().split())

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
def solve(m_list):
    m_val = m_list[0]
    for i in m_list:
        m_val = min(m_val,gcd(min_val,m))
    return min_val

def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

def main():
    n = int(input())
    m_list = list(map(int,input().split()))

    ans = solve(m_list)
    print(ans)

def solve(m_list):
    m_val = m_list[0]
    for i in m_list:
        m_val = min(m_val,gcd(min_val,m))
    return min_val

def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

def main():
    n = int(input())
    m_list = list(map(int,input().split()))

    ans = solve(m_list)
    print(ans)

if __name__ == '__main__':
    main()

def solve(m_list):
    m_val = m_list[0]
    for i in m_list:
        m_val = min(m_val,gcd(min_val,m))
    return min_val

def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

def main():
    n = int(input())
    m_list = list(map(int,input().split()))

    ans = solve(m_list)
    print(ans)
main()

def solve(m_list):
    m_val = m_list[0]
    for i in m_list:
        m_val = min(m_val,gcd(min_val,m))
    return m_val

def gcd(a,b):
    while b:
        a,b = b,a%b
    return a

def main():
    n = int(input())
    m_list = list(map(int,input().split()))

    ans = solve(m_list)
    print(ans)

main()

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

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

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
　# ABC118A

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


# ABC118A

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


Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A, B = map(int, input.split())

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

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b = list(map(int, input().split()))
print(b // a if b % a == 0 else b - a)

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


Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
str = input().strip()

a = int(str[1])
b = int(str[2])

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

str = input().strip()

a = int(str[1])
b = int(str[2])

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b = int(x) for x in input().split()
if (!b%a):
    print(a+b)
else:
    print(b-a)

a, b = (int(x) for x in input().split())
if (b % a):
    print(b-a)
else:
    print(b+a)

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
def solve():
    ans1, ans2 = map(int, input('数字を入れる\n').split(' '))
    if ans2 % ans1 == 0:
        print(ans1 + ans2)
    else:
        print(ans2 - ans1)

solve()

def solve():
    ans1, ans2 = map(int, input().split())
    if ans2 % ans1 == 0:
        print(ans1 + ans2)
    else:
        print(ans2 - ans1)

solve()

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A,B=map(int,input().split())
if(B//A==0):
  print(A+B)
else:
  print(A-B)

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


Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A, B=map(int, input())
print(A+B if B%A==0 else B-A)

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


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


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A, B = map(int, input())
print(A + B if B % A == 0 else B - A)

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):

n, m = map(int, input().split(' '))
ai = list(sorted(map(int, input().split(' '))))
required_maches = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}

used_numbers = dict()

def evaluate(l):
    if l == None:
        return -9999999999999999999999999999999
    if l == []:
        return 0
    return int(''.join(reversed([str(i) for i in sorted(l)])))

min_maches = min([required_maches[x] for x in ai])
def find(matches_count_to_use):
    if matches_count_to_use not in used_numbers:
        if matches_count_to_use < 0:
            used_numbers[matches_count_to_use] = None
        elif matches_count_to_use == 0:
            used_numbers[matches_count_to_use] = []
        else:
            candidates = list(filter(
                lambda x: find(matches_count_to_use - required_maches[x]) != None, ai))
            if len(candidates) == 0:
                used_numbers[matches_count_to_use] = None
            else:
                number_to_use = max(candidates,
                    key=lambda x: evaluate(find(matches_count_to_use - required_maches[x]) + [x]))
                prev = find(matches_count_to_use - required_maches[number_to_use])
                used_numbers[matches_count_to_use] = prev + [number_to_use]
                
    return used_numbers[matches_count_to_use]
    
print(evaluate(find(n)))

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A, B = map(int, input().split())
 
if B % A == 0：
    print(A + B)
else:
    print(B - A)
    

A, B = map(int, input().split())
1 <= A <= B <= 20

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

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

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

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

A, B = (int(i) for i in input().split())
1 <= B <= A <= 20
 
if B % A == 0：
    print(A+B)
else:
    print(A-B)

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


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

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

A, B = (int(i) for i in input().split())
1 <= B <= A <= 20

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

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

A, B = (int(i) for i in input().split())
1 <= B <= A <= 20
 
if A % B == 0：
    print(A+B)
else:
    print(A-B)

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b = [int(x) for x in input().split(" ")]
if a % b == 0:
  print(a+b)
else:
  print(b-a)

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
import sys

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

n,k=map(int,input().split())

if (n%k)==0:
	print(0)
else:
	print(1)

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)

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
import numpy as np


nmatch = np.array([0,2,5,5,4,5,6,3,7,6])
N,M = map(int,input().split())
dp = [-1]*(N+1) # contains the number of digits it can make
dp[0] = 0
ff = np.array(list(map(int,input().split()))).reshape(-1,1)
fg = nmatch[ff].reshape(-1,1)
Atemp = np.concatenate([ff,fg],axis=1)
index0 = np.argsort(Atemp[:,0])
index1 = np.argsort(Atemp[:,1])
A = Atemp[index1] #sorted by the number of matches: ascending
B = Atemp[index0]
B = B[::-1] #sorted by the number: descending
for i in range(1,N+1):
    for k in range(M):
        j = A[k,1]
        i_old = i - j 
        if (i-j) < 0:
            break
        if (i-j) == 0 and dp[i] == -1:
            dp[i] = 1
        if dp[i_old] != -1 and dp[i_old]+1 > dp[i]:
            dp[i] = dp[i_old] + 1
#print(dp)
ndigits = dp[N]
j = N
final_number = ''
for l in range(ndigits,0,-1):
    index = 0
    while True:
        temp_j = j - B[index,1]
        if temp_j < 0:
            index += 1
            continue
        if dp[temp_j] + 1 == dp[j]:
            final_number += str(B[index,0])
            j = temp_j
            break
        else:
            index += 1
        if index > M:
            break
print(int(final_number))


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


Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b=map(iunt,input().split())
print(a+b if b%a==0 else b-a)

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


Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b=map(int,input().split());print(a+b if b%a else a-b)

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

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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
# -*- coding: utf-8 -*-
A, B = list(map(int, input().split()))

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


# -*- coding: utf-8 -*-
A, B = list(map(int, input().split()))

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


Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
l=input().split()
a=int(l[0])
b=int(l[1])
if a%b==0:
    print(a+b)
elif:
    print(b-a)

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b = map(int, input().split())

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

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

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


Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A, B = (int(x) for x in input().split())
if B % A == 0:
  return A + B
else:
  return B - A

N, M = (int(x) for x in input().split())
KA = [[int(x) for x in l] for l in [input().split() for i in range(N)]]
[x.pop(0) for x in KA]
x = []
for s in KA:
  x.extend(s)
c = 0
for i in range(1, M + 1):
  c = c + (1 if x.count(i) == N else 0)
print(c)

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b = list(map(int,input().split()))
if b%a = 0:
  print(a+b)
else:
  print(a-b)

n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
def gcd(a,b):
  c = a%b
  if c == 0:
    return b
  else:
    return gcd(b,c)
c = 0
for i in a[1:]:
  c_ = gcd(i,a[0])
  if c_ == 1:
    c = 1
    break
  else:
    if c_ < c or c == 0:
      c = c_
print(c)


n,m = list(map(int,input().split()))
b = [0 for i in range(m)]
for i in range(n):
  ka = list(map(int,input().split()))
  k = ka[0]
  a = ka[1:]
  for j in range(k):
    b[a[j]-1] += 1
c = 0
for i in range(m):
  if b[i] == n:
    c += 1
print(c)


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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b = map(int,input().split())
if b%a:
  print(a+b)
else:
  print(b-a)

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b=[int(x) for x in input().split()]
if a%b==0:
    print(a+b)
else:
    print(b-a)


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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A,B = map(int,input().split())

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b=map(int,input().print())

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
import fraction

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

x = math.gcd(a[0],a[1])

if n != 2:
    for i in range(2,n):
        x = math.gcd(x,a[i])
        
print(x)

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b = map(int, input())
if b % a == 0:
  print(a + b)
else:
  print(b - a)

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


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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
N, K = list(map(int, input().split()))
print(N + K) if N % K == 0 else print(N - K) 

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b = (int(x) for x in input().split())
if b % a == 0:
  print(a+b)
 else:
  print(a-b)

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


Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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


Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.

__author__ = "c0117054"
__date__ = "$2019/02/18 19:31:49$"

if __name__ == "__main__":

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

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

# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.

__author__ = "c0117054"
__date__ = "$2019/02/18 19:31:49$"

if __name__ == "__main__":

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

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

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

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b = map(int, input())
if b % a == 0:
  print(a+b)
else:print(b-a)
  

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):

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


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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a=int(input())
b=int(input())

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


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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a, b= input().split()
print(a+b) if b%a==0 else print(b-a)

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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


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

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


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b=[int(i) for i in input().split()]

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

a,b=[int(i) for i in input().split()]

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
#coding: utf-8

A = int(input())
B = int(input())

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


#coding: utf-8

A = int(input())
B = int(input())

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


#coding: utf-8

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

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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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


Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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


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


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

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

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
A, B = map(int, imput().split())

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

A = imput()
B = imput()

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

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

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

A = imput()
B = imput()

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
#encoding: utf-8

N, M = map(int, input().split())
A = list(map(int, input().split()))
match = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

A.sort()
A.reverse()

dp = [-1] * (N + 1)
dp[0] = 0

for i in range(N + 1):
    for a in A:
        if i - match[a] >= 0:
            dp[i] = max(dp[i - match[a]] * 10 + a, dp[i])

print(dp[N])


#encoding: utf-8

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

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
import sys
import os
f = open("C:/Users/user/Documents/python/atcoder/ABC118/import.txt","r")
sys.stdin = f

# -*- coding: utf-8 -*-

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


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


Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
def math(A,B):
    if A%B ==0:
        print(A+B)
    else:
        print(B-A)
A,B = tuple(map(int, input().split()))

math(A,B)

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

math(A,B)

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
import math
n = int(input())
a_list = list(map(int, input().split()))
num = a_list[0]

for i in range(n):
    num = math.gcd(num, a_list[i])
print(num)

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):

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

N = A % B

if N==0:
  Ans = A+B
else:
  Ans = B-A

  
  
print(Ans)



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

print(Ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b = map(int,inout().split())
print(a+b if b%a == 0 else b-a)

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

Verdicts: Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
import sys 

A = int(sys.argv[1])
B = int(sys.argv[2])

if not (A >= 1):
  pass

if not (B <= 20):
  pass

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

# -*- coding: utf-8 -*-

import sys


def func_a(argv):
    A = int(argv[0])
    B = int(argv[1])

    if not (A >= 1):
        pass

    if not (B <= 20):
        pass

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


def main(argv):
    func_a(argv[1:])


if __name__ == "__main__":
    main(sys.argv)


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


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

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


if __name__ == "__main__":
    func_a(sys.argv)


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


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

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


if __name__ == "__main__":
    func_a(sys.argv[1:])


# -*- coding: utf-8 -*-

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

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


if __name__ == "__main__":
  func_a()


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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

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

Verdicts: Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

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



a,b=[int(i) for i in input().split()] 
if( a/b === 0){
  print a + b
} else {
  print b -a 
}


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


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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b=input().split()
print(a+b)


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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
N = int(input())
monstar = list(map(int, input().split()))
monstar.sort()
min1, min2 = monstar[0], monstar[1]
while min1 > 0 and min2 > 0:
  if min1 <= min2:
    min2 -= min1
  else:
    min1 -= min2
print(max(min1, min2))

import numpy as np
N, M = map(int, input().split())
menu = np.array([])
for i in range(N):
  a = np.array(input().split())
  menu = np.append(menu, a[1:])
menu = np.array(menu).astype(int).ravel()
count = 0
for i in range(1, M+1):
  if np.sum(menu == i) == N:
    count += 1
print(count)



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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given positive integers A and B.  If A is a divisor of B, print A + B; otherwise, print B - A.

Submission attempts (in order):
a,b=(int(x) for x in input().split())

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

a,b = (int(x) for x in input().split())

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

else:
    print(b-a)

Verdicts: Wrong Answer

Accepted