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):
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 = list(map(int,input().split()))
if (A==0) or (B == 0);
	print(A-B)

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

else:
	print(A-B)

A, B = list(map(int,input().split()))
if A or B == 0;
	print(A-B)

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

else:
	print(A-B)

A, B = list(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 a-b)

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):
import heapq

N = int(input())
A = list(map(int,input().split(' ')))
A_min = heapq.nsmallest(2,A)
X= A_min[0]
Y = A_min[1]

while X > 0 and Y > 0:
  if X <= Y:
    Y -= X
  else:
    X -= Y
print(max(X,Y))


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

def yakusuu(p):
	A.reverse()
	for i in range(1,p):
		if A[0] % A[i] == 0:
			A.pop(0)
			return
	else:
		return
def syou(k):
	A.sort()
	if A[0] == 0:
		A.pop(0)
		if len(A) > 1:
			A[k-1] = A[k-1] % A[0]
	else:
		A[k] = A[k] % A[0]
	return A
for i in range(N):
	if len(A) >= 1:
		yakusuu(len(A))
while	len(A) > 1:
	syou(len(A)-1)
print(A[0])

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 fractions
from functools import reduce

def gcd_list(numbers):
	return reduce(fractions.gcd,numbers)

n=int(input())
hp=list(map(int,input().split()))
print(gcd_list(hp))

a,b=map(int,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):
N = input()
A = int(N[0])
B = int(N[2])

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

print(ans)

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

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

print(ans)

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

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

print(ans)

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

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)


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):
l =input().split()

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

a, b = (int(i) for i in 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())

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

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

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

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

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

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

Verdicts: Wrong Answer

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):
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):
n,m=map(int, input().split())
mt=[0,2,5,5,4,5,6,3,7,6]
a=sorted(map(int, input().split()))
dp=['']*(n+1)
dp[0]='*'
for i in range(n+1):
    if not dp[i]:continue
    for j in a:
        if i+mt[j]<n+1:
            dp[i+mt[j]]=str(j)+dp[i]
print(''.join(sorted(dp[-1][:-1])[::-1]))

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

*l, = map(int, open(0).read().split())
if l[1] % l[0] == 0:
	print(l[0] + l[1])
else:
	print(l[1] - l[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):
num = int(input())
num_ls = sorted([x for x in map(int, input().split(' '))])
while True:
    dam = []
    searchMin = [ x for x in num_ls if x != 1 ]
    for x in num_ls:
        div = x % min(searchMin)
        if div == 0:
            dam.append(x)
        else:
            dam.append(div)

    if num_ls == dam:
        break
    else:
        num_ls = dam

print(min(num_ls))

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

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

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


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


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

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


Verdicts: Wrong Answer

Runtime Error

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):
from fractions import gcd

n = int(input())
e = [int(i) for i in input().split()] 


answer = 5000000000000000000000000000000000

e.sort(reverse=True)
for i in range(0,n-2):
    for j in e[i+1:n-1]:
        if gcd(e[i],j) < answer:
            answer = gcd(e[i],j)
            
print(answer)

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):
ii=lambda:int(input())
miis=lambda:map(int,input().split())
lmiis=lambda:list(:map(int,input().split()))

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

from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

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

def f(a, b):
    if (b % a == 0):
        return a + b 
    else:
        return b - a 

m = list(map(int, input().split()))

hp = list(map(int, input().split()))
result = 0
checkyakusuru = []
checkodd = []
checkeven = []

if (hp.count(hp[0]) == m[0]):
    result = hp[0]

minhp = min(hp)

for p in hp:
    if (p % minhp == 0):
        checkyakusuru.append(1)
    
    if (checkyakusuru.count(1) == m[0]):
        result = p
        break
    else:
        if (p % 2 == 0):
            checkeven.append(1)
        if (checkeven.count(1) == m[0]):
            result = 2
        else:
            result = 1

m = list(map(int, input().split()))

hp = list(map(int, input().split()))
result = 0
checkyakusuru = []
checkodd = []
checkeven = []

if (hp.count(hp[0]) == m[0]):
    result = hp[0]

minhp = min(hp)

for p in hp:
    if (p % minhp == 0):
        checkyakusuru.append(1)
    
    if (checkyakusuru.count(1) == m[0]):
        result = p
        break
    else:
        if (p % 2 == 0):
            checkeven.append(1)
        if (checkeven.count(1) == m[0]):
            result = 2
            break
        else:
            result = 1

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

def f(a, b):
    if (b % a == 0):
        return a + b 
    else:
        return b - a 
print(f(a[0], a[1]))

Verdicts: 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):
[a, b] = read().split().map(int)
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(B/A)
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):
import fraction
from functools import reduce


def gcd_list(numbers):
    return reduce(fraction.gcd, numbers)


N = input()
A = input().split()
for i in range(len(A)):
    A[i] = int(A[i]) 
print("{}".format(gcd_list(A)))

A, B = map(int, input().split())
if B%A==0:
    print("{}".format(A+B))
else:
    print("{}".format(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, 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):
x, y = 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 = list(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()))
print(a+b if b%a == 0 else b-a)

a, b = list(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):
from collections import Counter;N, M = map(int, input().split());print(len([i for i in Counter([flatten for inner in [i[1:] for i in [[int(i) for i in input().split()] for i in range(N)]] for flatten in inner]).most_common() if i[1] == N]))

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())
ans=[0]*m
for i in range(n):
  x=[int(a),for a in input().split()]
  for j in range(1,x[0]+1):
    ans[x[j]-1]+=1
  
print(ans.count(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):
x,y=map(int,input().split())
print([y-x,x+y][y//x == 0] )

x,y=map(int,input().split())
print([y-x,x+y][y%x==0])

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):
x,y = map(int,input().split())
if x >= y and x % y == 0:
  print(str(x + y))
else:
  print(str(y - x))

x,y = map(int,input().split())
if x % y == 0:
  print(str(x + y))
else:
  print(str(x - y))

x,y = map(int(input()))
if x % y == 0:
  print(str(x + y))
else:
  print(str(x - y))

x,y = map(int,input().split())
if x % y == 0:
  print(str(x + y))
else:
  print(str(y - x))

x,y = map(int,input().split())
if y % x == 0:
  print(str(x + y))
else:
  print(str(y - x))

Verdicts: Wrong Answer

Wrong Answer

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

def main():
    A, B = map(int, input().split())

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

input = lambda: stdin.readline()
main()


from sys import stdin

def main():
    A, B = map(int, input().split())

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

input = lambda: stdin.readline()
main()


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=int(input())
a=sorted(list(map(int,input().split())))
i=0
while(a[1] != 0):
    a[i+1]=a[i+1]-(a[i+1]//a[i])*a[i]
    a=sorted(a)
    if(a[0] == 0):
        i += 1
        while(a[1] != 0):
            a[i+1]=a[i+1]-(a[i+1]//a[i])*a[i]
            a=sorted(a)
print(a[i+1])

n=int(input())
a=sorted(list(map(int,input().split())))
i=0
while(a[-2] != 0):
    if(a[-1]%a[i]==0):
        a[-1]=0
        i+=1
    else:
        a[-1]=a[-1]-(a[-1]//a[i])*a[i]
    a=sorted(a)
print(a[-1])

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, m = map(int, input().split())
cnt = [0] * m
for _ in range(n):
    k, *a = map(int, input().split())
    for A in a:
        cnt[A - 1] += 1
print(sum(c == n for c in cnt))


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

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

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==1:
  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):
import fractions
from functools import reduce

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

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

print(gcd(*A))

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

if int(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):
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 20:59:16 2019

@author: doppe
"""

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

for i in range(0, N):
    L = [int(i) for i in input().split()]
    likeListTmp = []
    if (i == 0):
        likeList = L
    else:
        for j in range(1, L[0] + 1):
            if (L[j] in likeList):
                likeListTmp.append(L[j])
        likeList = likeListTmp

print(len(likeList))

# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 20:59:16 2019

@author: doppe
"""

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(i) for i in input().split())  
  
if a/b % 0:
	c = a + b
else:
	c = b - a
    
print(c)


a, b = (int(i) for i in input().split())  
  
if a/b == 0:
	c = a + b
else:
	c = b - a
    
print(c)


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


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

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


Verdicts: Runtime Error

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):
n, m = [int(c) for c in input().split()]
 
k = [list(map(int, input().split())) for _ in range(n)]
 
food_count = [0] * m
 
for p in k:
    for i in range(1, len(p)):
        food_count[p[i]-1] += 1
 
count = 0
for f in food_count:
    if f == 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

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(int(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 main():
	s = input().strip()
	a = s[0]
	b = s[1]
	if (b/a)*a == b:
		print(a+b)
	else:
		print(b-a)

if __name__ == '__main__':
	main()

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

if __name__ == '__main__':
	main()

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

if __name__ == '__main__':
	main()

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,inpit().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 = 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

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()))
a.sort(reverse=True)
num=[0,2,5,5,4,5,6,3,7,6]
canmake=dict()
b=[]
for i in a:
    b.append(num[i])
    if num[i] not in canmake.keys():
        canmake[num[i]]=i
b.sort()
c=[]
d=[]
amari=n%b[0]
longest=n//b[0]
if amari==0:print(str(b[0])*(n//b[0]))

for i in range(1,len(b)):
    count=0
    now=amari
    while True:
        count+=1
        now+=b[0]
        if count>b[i]:break
        if now%b[i]==0:
            c.append(count-now//b[i])
            d.append((count,now//b[i],b[i]))
            break
res=min(c)
ans=[]
for i in range(c.count(res)):
    an=dict()
    idx=c.index(res)
    an[b[0]]=longest-d[idx][0]
    an[d[idx][2]]=d[idx][1]
    ans.append(an)
    c[idx]=-1

result=0
for i in ans:
    x=[]
    for i in an.keys():
        x.append((canmake[i],an[i]))
    x.sort(key=lambda y:y[0])
    re=''
    for i in range(len(x)):
        y=x.pop()
        re+=str(y[0])*y[1]
    ima=int(re)
    if ima>result:result=ima
        
if amari!=0:print(result)

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):
#!/usr/bin/python
# coding: UTF-8
a,b = map(int,input().split())

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

#!/usr/bin/python
# coding: UTF-8
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(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()))
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=int(input())
A=list(map(int,input().split()))

while len(set(A))!=1:

    A.sort()
    for i in range(len(A)-1):
        if A.count(0):
            A.remove(0)
            break
        A[i+1]=A[i+1]%A[0]

print(max(A))

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

while len(set(A)!=1:

    A.sort()
    for i in range(len(A)-1):
        if A.count(0):
            A.remove(0)
            break
        A[i+1]=A[i+1]%A[0]

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

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

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

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 sys

def chk(i,j):
    tmp=[p[i][k] for k in range(M)]
    tmp[j]=p[i][j]+1
    for k in range(M-1,-1,-1):
        if tmp[k] > p[i+x[j]][k] :
            p[i+x[j]]=[tmp[k] for k in range(M)]

N,M=map(int,input().split())
x=[0,2,5,5,4,5,6,3,7,6]
a=list(map(int,input().split()))
a.sort()
b=[]
for i in range(M):
    for j in range(M):
        if x[a[j]]==x[a[i]]: tmp=j
    b.append(a[tmp]) 

a=list(set(b))
a.sort()
M=len(a)
x=[ x[a[i]] for i in range(M) ]


p=[-100 for i in range(N+10)]
p[0]=0
for i in range(N):
    if p[i]>-1:
        for j in range(M):
            p[i+x[j]]=max(p[i+x[j]],p[i]+1)

ans=""
while N>0:
    for j in range(M-1,-1,-1):
        if p[N]==p[N-x[j]]+1:
            ans+=str(a[j])
            N-=x[j]
            break
print(ans)




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

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 = [int(x) for x in input().split()]
print(a[0] - a[1])

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

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().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)


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

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

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

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

n,m = map(int,input().split())
if m % n == 0:
    print(n + m)
else:
    print(m - 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=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):
N = int(input())
for i in range(N):
    for j in range(N-i):
        if j == N-i-1:
            print(N)
        else:
            print(N,end='')

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):
N = int(input())
life_list = list(map(int, input().split()))
life_list.sort()
while life_list[1] - life_list[0] > 0:
    if life_list[1] == life_list[0]:
        break
	life_list[1] = life_list[1] - life_list[0]
    life_list.sort()
        
print(life_list[0])



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, 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())
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 == B//A:
    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


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


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


import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


a, b = LI()
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(i) for i in 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:
  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(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):
s=input()
if int(s[5:7])<5:
	print('Heisei')
else:
	print('TBD')

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

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

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

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

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

import math
A,B=map(int, input().split())
print (B+A-2*A*math.ceil(B%A/20))

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())
l=[]
for _ in range(n):
    k,*s=input().split()
    l+=s
se=set(l)
a=0
for i in se:
    c=l.count(i)
    if c==n:
        a+=1
print(a)


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


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

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

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


if __name__ == "__main__":
    main()



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


if __name__ == "__main__":
    main()



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


if __name__ == "__main__":
    main()


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


if __name__ == "__main__":
    main()


Verdicts: Runtime Error

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):
N,K = map(int,input().split())
K_A = []
for i in range(N):
	K_A.append(list(map(int,input().split())))

l = []

for i in range(N):
	del K_A[i][0]
	for j in range(len(K_A[i])):
		l.append(K_A[i][j])
		
count = 0

for i in range(K+1):
	if l.count(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

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

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

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())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]

for i in range(N-1):
  a = set(l[i])&set(l[i+1])
  l[i+1] = a
print(len(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())
return A+B if B % A == 0 else B-A

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

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

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

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):
from fractions import gcd
from functools import reduce
input()
print(reduce(gcd,list(map(int,input().split()))))

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 = [int(x) for x in input().split()]
food_list = [0 for x in range(m)]

for i in range(n):
  s = [int(x) for x in input().split()]
  k = s[0]
  e = s[1:]
  for j in range(k):
    food_list[e[j]-1] += 1

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

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

A,B=input().split()
A=int(A)
B=int(B)
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(' ')

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

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):
data = input().split()
A = data[0]
B = data[1]
if (B % A) == 0 :
    ANS = A+B
else:
    ANS = B - A
print(ANS)

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

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):
inputData1 = int(input())
inputData2 = int(input())
ans = 0
if inputData2 % inputData1 ==0:
    ans = inputData1 + inputData2
else:
    ans = inputData2 - inputData1
print(ans)

inputData1 = int(input())
inputData2 = int(input())
ans = 0
if inputData2 % inputData1 ==0:
    ans = inputData1 + inputData2
else:
    ans = inputData2 - inputData1
print(ans)

inputData = input().split(' ')
ans = 0

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

inputData = input().split(' ')
ans = 0

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted