Problem:


Score : 100 points

Problem Statement

You are given positive integers X and Y.
If there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it.
If it does not exist, print -1.

Constraints

1 ≤ X,Y ≤ 10^9

X and Y are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

Print a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, or print -1 if it does not exist.

Sample Input 1

8 6

Sample Output 1

16

For example, 16 is a multiple of 8 but not a multiple of 6.

Sample Input 2

3 3

Sample Output 2

-1

A multiple of 3 is a multiple of 3.



Sample input:
8 6


Sample output:
16

Submission status: Runtime Error

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

""" 
theorem, if the gcd(a,b) = b then every multiple of a is a multiple of b, since b is a factor of a

proof: gcd(a,b) = b => bk = a => al = b(kl) ---- I think
"""

""" implementation of gcd (greatest common multiple) using euclidean algorithm """
def gcd(a, b):
  if b > a:
    return gcd(b,a)
  if b == 0:
    return a
  return gcd(b, a%b)

""" Finds the first non common multiple """
def NCM(x, y):
  if x == y:
    return -1
  elif x > y:
    if gcd(x,y) == y:
      return -1
  return help(x,y)[0]

def help(x,y):
  a,b = 2,2
  while x*a < 10**8:
    while y*b < x*a:
      b += 1
    if y*b != x*a:
      return (x*a, y*b)
    a += 1
  return -1

result = NCM(X, Y)
print(result)

Submission status: Runtime Error

Solution code:
N=int(input())
print(0,flush=True)
s=input()
if s=="Vacant":
    exit()
cap=0
if s=="Female":
    cap=1
lo=0
hi=N
while(1):
    mid=(lo+hi)//2
    print(mid,flush=True)
    s=input()
    if s=="Vacant":
        exit()
    gen=0
    if s=="Female":
        gen=1
    if (cap+mid)%2==gen:
        lo=mid
    else:
        hi=mid

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
abig = 0
bbig = 0
for i in range(n):
    if a[i] > b[i]:
        abig += 1
    elif a[i] < b[i]:
        bbig += 1
if abig % 2 == bbig % 2:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
x, y = map(int,input().split())
print([x, -1][x%y])

Submission status: Runtime Error

Solution code:
x, y = map(int,input().split())
print([-1, x][y%x])

Submission status: Runtime Error

Solution code:
if x%y==0:
    print(-1)
else:
    if x*(y+1)<=10**18:
        print(x*(y+1))
    else:
        print(-1)

Submission status: Runtime Error

Solution code:
import math
x, y = map(int, input().split())

def lcm(x,y):
    return (x * y)//math.gcd(x, y)

def thingo(x,y):
    if (x == 0 and y == 0):
        return -1
    if (x != 0 and y == 0):
        return x
    test = lcm(x,y)
    if (test-x >= x):
        return test-x
    else:
        return -1
print(thingo(x,y))

Submission status: Runtime Error

Solution code:
import math
x, y = map(int, input().split())

def lcm(x,y):
    return (x * y)//math.gcd(x, y)

def thingo(x,y):
    if (x == 0 and y == 0):
        return -1
    if (x != 0 and y == 0):
        return x
    test = lcm(x,y)
    if (test-x >= x):
        return test-x
    else:
        return -1
print(thingo(x,y))

Submission status: Runtime Error

Solution code:
import math
x, y = map(int, input().split())
def lcm(x,y):
    return (x * y)//math.gcd(x, y)

def thingo(x,y):
    if (x == 0 and y == 0):
        return -1
    if (x != 0 and y == 0):
        return x
    test = lcm(x,y)
    if (test-x >= x):
        return test-x
    else:
        return -1
print(thingo(x,y))

Submission status: Runtime Error

Solution code:
import math

input = str(input()).split(" ")
for index in range(len(input)):
    input[index] = int(input[index])
x = input[0]
y = input[1]

def lcm(x,y):
    return (x * y)//math.gcd(x, y)

def thingo(x,y):
    test = lcm(x,y)
    if (test-x >= x):
        return test-x
    else:
        return -1
print(thingo(x,y))

Submission status: Runtime Error

Solution code:
import math

input = str(input()).split(" ")
for index in range(len(input)):
    input[index] = int(input[index])
x = input[0]
y = input[1]

def ahaha(x, y):
    for index in range(1, min(abs(y), math.floor((10**(18))/x)):
        if (x * index % y != 0):
            return x * index
    return -1

print(ahaha(x,y))

Submission status: Runtime Error

Solution code:
import math

input = str(input()).split(" ")
for index in range(len(input)):
    input[index] = int(input[index])
x = input[0]
y = input[1]

def ahaha(x, y):
    for index in range(2, abs(y)):
        if (x * index % y != 0 and abs(x * index) <= 10**(18)):
            return x * index
    return -1

def test(x,y):
    thingo = True
    bigThingo = 1
    while thingo:
        div = math.gcd(x,y)
        bigThingo = bigThingo * div
        x = int(x/div)
        y = int(y/div)
        if (div == 1):
            thingo = False
    if (x == 1 or y == 1):
        return -1
    else:
        if (ahaha(x,y) * bigThingo > 10**18):
            return -1
        else:
            return ahaha(x,y) * bigThingo
print(test(x,y))

Submission status: Runtime Error

Solution code:
import math

input = str(input()).split(" ")
for index in range(len(input)):
    input[index] = int(input[index])
x = input[0]
y = input[1]

def canBeDone(x,y):
    thingo = True
    while thingo:
        div = math.gcd(x,y)
        x = int(x/div)
        y = int(y/div)
        if (div == 1):
            thingo = False
    if (x == 1 and y == 1):
        return -1
    else:
        return 1

def test(x, y):
    if (canBeDone(x,y) == -1):
        return -1
    for index in range(math.floor(y/x)-1, abs(y)):
        if (x * index % y != 0 and abs(x * index) <= 10**(18)):
            return x * index
    return -1
print(test(x,y))

Submission status: Runtime Error

Solution code:
import math

input = str(input()).split(" ")
for index in range(len(input)):
    input[index] = int(input[index])
x = input[0]
y = input[1]

def canBeDone(x,y):
    thingo = True
    while thingo:
        div = math.gcd(x,y)
        x = int(x/div)
        y = int(y/div)
        if (div == 1):
            thingo = False
    if (x == 1 and y == 1):
        return -1
    else:
        return 1

def test(x, y):
    if (canBeDone(x,y) == -1):
        return -1
    for index in range(1, abs(y)):
        if (x * index % y != 0 and abs(x * index) <= 10**(18)):
            return x * index
    return -1
print(test(x,y))

Submission status: Runtime Error

Solution code:
X, Y = map(int, input().split())

if (X `mod` Y == 0):
    print(-1)
else:
    print(X)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x,y=map(int,input().split())
if x%y==0:
  print(-1)
else:
  pritn(x)

Submission status: Runtime Error

Solution code:
import math
from functools import reduce
from fractions import gcd

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

X,Y = map(int,input().split())
if lcm(X,Y)//X > 10**18 or X == Y:
  print(-1)
else:
  print(lcm(X,Y)//X)

Submission status: Runtime Error

Solution code:
import sys
input=sys.stdin.readline
n=int(input())

def bin(start):
    ok=0
    ng=n
    while abs(ng-ok)>1:
        mid=(ok+ng)//2
        print(mid)
        sys.stdout.flush()
        s=input()
        if s=='Vacant':exit()
        if mid%2==0 and start==s:
            ok=mid
        elif mid%2!=0 and start!=s:
            ok=mid
        else:
            ng=mid
print(0)
start=input()
sys.stdout.flush()
if start=='Vacant':exit()
bin(start)

Submission status: Runtime Error

Solution code:
X ,Y = mao(int,input().split())

if (Y != 1)and(Y!=X):
  print(X)
else:
  print(-1)

Submission status: Runtime Error

Solution code:
# 8 = 2 * 2 * 2
# 6 = 2 * 3
x = int(input())
y = int(input())
result = 0

if x % y == 0:
    result = -1
else:
    result = x * 2


print(result)

Submission status: Runtime Error

Solution code:
# 8 = 2 * 2 * 2
# 6 = 2 * 3
x = int(input())
y = int(input())
result = 0

if x % y == 0:
    result = -1
else:
    result = x
print(result)

Submission status: Runtime Error

Solution code:
X , Y = map(int, input()split())

if X%Y == 0:
  print(-1)
else:
  i = 1
  while True:
    if X*i%Y != 0:
      print(X*i)
      break

Submission status: Runtime Error

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


N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
n = sum(b) - sum(a)
cnt = 0
for _a, _b in zip(a, b):
    if _a < _b:
        cnt += ceil(_b - _a, 2)
if cnt <= n:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def my_round(a,dig=0):
    p = 10 ** dig
    return (a * p * 2 + 1) // 2 / p

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

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

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): #素因数分解
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    x,y = map(int,input().split())
    _lcm = lcm(x,y)
    num = x * 2
    while num <= lcm:
        if num % y != 0:
            print(num)
            return
        num += x
    print(-1)
    return

if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
x,y=map(int,input().split()
l=[x,y]
l=sorted(l)
if l[1]%l[0]==0:
  print(-1)
else:
  print(x)

Submission status: Runtime Error

Solution code:
import sys
x,y=map(int,input().split())
ans=1
i=1
while ans<=10**18:
  ans=i*x
  if ans%y=!0
    print(ans)
    sys.exit()
  i+=1
print(-1)

Submission status: Runtime Error

Solution code:
import sys
x,y=map(int,input().split())
ans=1
i=1
while ans<=10**18:
  ans=i*x
  if ans%y!=0
    print(ans)
    sys.exit()
  i+=1
print(-1)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
limit = sum(B) - sum(A)
cnt_A = 0
cnt_B = 0
for i in range(N):
  if A[i] > B[i]:
    cnt_B += A[i] - B[i]
  elif A[i] < B[i]:
    cnt_A += math.ceil((B[i] - A[i]) / 2)
if cnt_A <= limit and cnt_B <= limit:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
X, Y = map( int, input().split() )
if Y % X == 0 or X % Y == 0
   print( -1 )
else 
   print( X )

Submission status: Runtime Error

Solution code:
def main():
    X,Y = map(int,input())
    if X%Y==0:
        print(-1)
    else:
        for i in range(1,10**8):
            if (X*i)%Y != 0:
                print(X*i)
                exit()
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n=int(input())
l=0;r=n-1
print(0);seat0=input()
if seat0="Vacant";exit()
while True:
  mid=(l+r)//2
  print(mid)
  seat=input()
  if seat=="Vacant":
    exit()
  if mid%2==0:
    if seat!=seat0:
      r=mid
    else:
      l=mid
  elif mid%2==1:
    if seat==seat0:
      l=mid
    else:
      r=mid

Submission status: Runtime Error

Solution code:
import sys

n = int(input())
l = 0
r = n-1
mid = r // 2
re = [None] * n
print(0, flush=True)
re[0] = input()
if re[0] == "Vacant":
  sys.exit()
print(mid, flush=True)
re[mid] = input()
while re[mid] != "Vacant":
  if re[l] == re[mid]:
    if (mid - l) % 2:
      r = mid
    else:
      l = mid
  else:
    if (mid - l) % 2:
      l = mid
    else:
      r = mid
  mid = (l + r) // 2
  print(mid, flush=True)
  re[mid] = input()
else:
  sys.exit()

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
need=sum(b)-sum(a)
import math
x=0
a.sort()
b.sort()
for i in range(n):
	if a[i]>b[i]:
		x+=a[i]-b[i]
	else:
		x+=math.ceil((b[i]-a[i])/2)
if x<=need:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
x, y = int(input())
if x % y == 0 or  y % x == 0:
    print(-1)
else:
    print(x * 1)

Submission status: Runtime Error

Solution code:
x,y=map(int,input())
if y==0:
  print(x)
elif x%y==0:
  print(-1)
else:
  print(x)

Submission status: Runtime Error

Solution code:
x,y=map(int,input())
if x%y==0:
  print(-1)
else:
  print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
X,Y = [int(x) for x in input().split()]
lcm = X*Y//math.gcd(X,Y)
if(lcm==X):
    print(-1)
else:
    print(X)

Submission status: Runtime Error

Solution code:
import math
X,Y = [int(x) for x in input().split()]
lcm = X*Y//math.gcd(X,Y)
if(lcm//X<=2):
    print(-1)
else:
    print(X*2)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
#APC1 A

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a,b = LI()
if a % b == 0:
  print(-1)
tmp = 1
while 1:
  if tmp % a == 0 and tmp % != 0:
    print(tmp)
    quit()
  tmp += 1

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split())

if yx% y == 0:
    print(-1)
else:
    print(x)

Submission status: Runtime Error

Solution code:
N = int(input())

def ask(n):
    print(n, flush=True)
    resp = input().rstrip()[0]
    if resp == 'V':
        exit()
    return resp

resp = ask(0)

def condition(L,R,resp_L,resp_R):
    if (R-L)&1:
        return resp_L == resp_R
    else:
        return resp_L != resp_R

L = 0
R = 0
resp_L = resp
resp_R = resp
for _ in range(19):
    M = (L + R) // 2
    resp_M = ask(M)
    if condition(L,M,resp_L,resp_M):
        R,resp_R = M,resp_M
    else:
        L,resp_L = M,resp_M

Submission status: Runtime Error

Solution code:
def ask(n):
    print(n, flush=True)
    resp = input().rstrip()[0]
    if resp == 'V':
        exit()
    return resp

resp = ask(0)

def condition(L,R,resp_L,resp_R):
    if (R-L)&1:
        return resp_L == resp_R
    else:
        return resp_L != resp_R

L = 0
R = N
resp_L = resp
resp_R = resp
for _ in range(19):
    M = (L + R) // 2
    resp_M = ask(M)
    if condition(L,M,resp_L,resp_M):
        R,resp_R = M,resp_M
    else:
        L,resp_L = M,resp_M

Submission status: Runtime Error

Solution code:
N=int(input())
A,B=[sorted(map(int,input().split())) for _ in range(2)]
print("Yes" if all([a<=b for a, b in zip(A,B)]) else "No")

Submission status: Runtime Error

Solution code:
n = int(input())
count = 0
for i in range(1,n+1):
    count = count + i*i
print(count)

Submission status: Runtime Error

Solution code:
X,Y=map(input().split())
if X%Y==0:
    print(-1)
else:
    X2=X
    while X2>10**18:
        X2+=X
        if X2%Y!=0:
            print(X2)
            exit()
print(-1)

Submission status: Runtime Error

Solution code:
print(x if x%y==0 else -1)

Submission status: Runtime Error

Solution code:
X, Y = [int(x) for x in input()]

def solve(X, Y):
    if X == 1:
        return -1
    if X == Y:
        return -1
    for x in range(X, 10**18+1, X):
        if x % Y != 0:
            return x
solve(X, Y)

Submission status: Runtime Error

Solution code:
import math
x,y=map(int,input().split())
a=x*y/math.gcd(x,y)
a-=x
if a>0 and a<10**19:
     print(int(a))
else:
     print(-1)

Submission status: Runtime Error

Solution code:
x,y=map(int,input().split)
if x%y==0:
  print(-1)
else:
  flag=0
  for i in range(10**18//x):
    if (i*x)%y!=0:
      print(i*x)
      flag=1
      break
    if flag==0:
      print(-1)

Submission status: Runtime Error

Solution code:
X, Y = map(int, input().split())

def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x%y)

g = Y / gcd(X, Y)

if g == 1:
  print("-1")
else:
  if g == 2:
    g = 3
  else:
    g = 2
  ans = X * g
  if ans <= 1e18:
	print(ans)
  else:
    print("-1")

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
count = - sum(A) + sum(B)
for i in range(N):
  inv = max(0, A[i] - B[i])
  
if count >= 0 and inv <= count:
  print("Yes")
else :
  print("No")

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
x = int(input())
y = int(input())
if x % y  == 0 or x > 10**18:
	print(-1)
else:
	print(2*x)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
x = int(input())
y = int(input())
if x % y  == 0 or x > 10**18:
	print(-1)
else:
	print(x)

Submission status: Runtime Error

Solution code:
N = int(input())
lia=[int(it) for it in input().split()]
lib=[int(it) for it in input().split()]
lip=[lia[i]-lib[i] for i in range(N)]
sb = 0
for i in range(N):
  if (lip[i]>0):
    sb+=lip[i]
sa2 = 0
for i in range(N):
  if (lip[i]<0):
    sa2+=(-lip[i])//2
x = sum(lib)-sum(lia)
if (x<0):
  print ("No")
else:
  if (sa2>=sb):
    print ("Yes")
  else:
    print ("No")

Submission status: Runtime Error

Solution code:
N = int(input())
lia=[int(it) for it in input().split()]
lib=[int(it) for it in input().split()]
lip=[lia[i]-lib[i] for i in range(N)]
sb = 0
for i in range(N):
  if (lip[i]>0):
    sb+=lip[i]
sa2 = 0
for i in range(N):
  if (lip[i]<0):
    sa2=(-lip[i])//2
x = sum(lib)-sum(lia)
if (x<0):
  print ("No")
else:
  if (sa2>=sb):
    print ("Yes")
  else:
    print ("No")

Submission status: Runtime Error

Solution code:
N = int(input())
lia=[int(it) for it in input().split()]
lib=[int(it) for it in input().split()]
lip=[lia[i]-lib[i] for i in range(N)]
sb = 0
for i in range(N):
  if (lip[i]>0):
    sb+=lip[i]
sa2 = 0
sas = 0
for i in range(N):
  if (lip[i]<0):
    sa2=(-lip[i])//2
    sas+=(-lip[i])
sas-=sb*2
x = sum(lib)-sum(lia)

if (sa2>=sb and sb+sas == x):
  print ("Yes")
else:
  print ("No")

Submission status: Runtime Error

Solution code:
from collections import defaultdict as d
p=d(str)
n=int(input())
print(0, flush = True)
s = input()
if s == "Vacant": exit()
else:
    print(n-1,flush=True)
    t=input()
    if t == "Vacant": exit()
    else:
        p[0]=s
        p[n-1]=t
        l=0
        r=n-1
        while 1:
            g=(l+r)//2
            if p[l]=="":
                print(l, flush = True)
                s = input()
                p[l]=s
                if s == "Vacant": exit()
                else:
                    s=p[l]
            if p[g]=="":
                print(g, flush = True)
                t = input()
                p[g]=t
                if t == "Vacant": exit()
                else:
                    t=p[g]
            if ((g-l)%2!=0 and s!=t) or ((g-l)%2!=1 and s==t):
                l=g+1
            else:
                r=g-1

Submission status: Runtime Error

Solution code:
x,y=map(int,input()..split())
if x%y==0:
  print(-1)
else:
  print(x)

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)>=sum(b):
    print("No")
else:
    ans=0
    lim=sum(b)-sum(a)
    for i in range(n):
        if a[i]<b[i]:
            ans+=(b[i]-a[i])//2
    if ans>lim:
        print("No")
    else:
        print("Yes")

Submission status: Runtime Error

Solution code:
num = input().split(" ")
[i = int(i) for i in num]

if num[0]%num[1]==0:
  print("-1")
else:
  print(num[0])

Submission status: Runtime Error

Solution code:
num = int(input()).split(" ")
ans=0
for i in range(10**18):
  if i%num[0]==0 and i%num[1]!=0:
    ans=i
    break
  else:
    pass
if ans==0: print(-1)
else: print(ans)

Submission status: Runtime Error

Solution code:
X,Y = map(int,input())
if X==Y:
  print(-1)
elif 2*X!=Y:
  print(2*X)
else:
  print(3*X)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))

a_cnt = 0
b_cnt = 0

for i in range(N):
    a = a_list[i]
    b = b_list[i]

    if a == b:
        continue
    elif a > b:
        a_cnt += a - b

    else:
        b_cnt += (b - a) // 2

cnt = a_cnt + b_cnt
if cnt < sum(b_list) - sum(a_list):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
[print(x*(y-1) if y%=x else -1) for x,y in [[int(i) for i in input().split()]]]

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math
x, y = map(int, input().split())
if math.gcd(x, y) == x:
	print(-1)
else:
	print(x)

Submission status: Runtime Error

Solution code:
from math import gcd
X, Y = map(int, input().split())
if X % Y == 0:
    print(-1)
else:
    print(X)

Submission status: Runtime Error

Solution code:
x,y=[int(x)for x in input().split()[0]]
if(x%y!=0):
    print(x)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
X, Y = map(int, raw_input().split())
test = 0
if (X % Y == 0):
        test = 1
        print("-1")
else:
        for i in range(2*X, 1000000000, X):
                if i % Y != 0:
                        print(i)
                        test = 1
                        break
if test == 0:
        print("-1")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
X, Y = map(int, raw_input().split())
if (X % Y == 0):
        print("-1");
else:
        for i in range(2*X, 1000000000, X):
                if i % Y != 0:
                        print(i)
                        break

Submission status: Runtime Error

Solution code:
import math
x, y = map(int, input().split())

if x == y or x == 1 or y == 1:
  print(-1)
else:
  print(int(x * y / math.gcd(x, y) - x))

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
using namespace std;

int a,b;

int main()
{
	cin>>a>>b;
	if(a%b==0||b%a==0) { cout<<-1<<endl; return 0; }
	cout<<x<<endl;	
    return 0;
}

Submission status: Runtime Error

Solution code:
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('integers', metavar='N', type=int, nargs='+',
               help='an integer for the accumulator')

args = parser.parse_args()
int_list = args.integers

if int_list[0] == int_list[1]: 
    print(-1)
elif int_list[0] < 0 or int_list[1] < 0: 
    print (-1)
else:
    for i in range(1, int(10 ** 10 / int_list[0])):
        if int_list[0] * i % int_list[1] != 0:
            print(int_list[0] * i)
            exit()
        else:
            continue
    print(-1)

Submission status: Runtime Error

Solution code:
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('integers', metavar='N', type=int, nargs='+',
               help='an integer for the accumulator')

args = parser.parse_args()

if args[0] == args[1]: 
    print(-1)
elif args[0] < 0 or args[1] < 0: 
    print (-1)
else:
    for i in range(1, 10 ** 10 / args[0]):
        if args[0] * i % args[1] != 0:
            print args[0] * i
            break
print(-1)

Submission status: Runtime Error

Solution code:
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('integers', metavar='N', type=int, nargs='+',
               help='an integer for the accumulator')

args = parser.parse_args()

if args[0] == args[1]: 
    print(-1)
elif args[0] < 0 or args[1] < 0: 
    print (-1)
else:
    for i in range(1, 10 ** 10 / args[0]):
        if args[0] * i % args[1] == 0:
            print args[0] * i
            break
print(-1)

Submission status: Runtime Error

Solution code:
X, Y=map(int, input().split())
i=X+X
MAX=10 ** 18
 
if X%Y== 0 or Y%X ==0:
    print(-1)
else:
    while i<MAX:
        if i%Y != 0:
            print(i)
            break
        i+=X
X, Y=map(int, input().split())
i=X+X
MAX=10 ** 18

if X%Y== 0:
    print(-1)
else:
    while i<MAX:
        if i%Y != 0:
            print(i)
            break
        i+=X

Submission status: Runtime Error

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

c = 0
for i in range(n):
    ai = a[i]
    bi = b[i]
    if ai < bi:
        c += (bi-ai)//2
    else:
        c -= (ai-bi)
print('Yes' if c >= 0 else 'No')

Submission status: Runtime Error

Solution code:
class State:
  def __init__(self, n, c0, c1):
    self.n = len(c0)
    self.c0 = c0
    self.c1 = c1
    self.nok = 0

  def operate(self):
    for i in xrange(self.nok,self.n):
      if(self.c0[i]<self.c1[i] or i==self.n-1):
        self.c0[i] += 2
        break
    for i in xrange(self.nok,self.n):
      if(self.c0[i]>self.c1[i] or i==self.n-1):
        self.c1[i] += 1
        if(self.c0[i]==self.c1[i]):
          self.nok = i
        break


if __name__=='__main__':
  n = int(raw_input()) 
  c0 = map(int, raw_input().split())
  c1 = map(int, raw_input().split())

  nop = sum(c1) - sum(c0)  
  s = State(n, c0, c1)
  for i in xrange(nop):
    s.operate()
    print s.c0
    print s.c1

  
  if (c0==c1):
    print 'Yes'
  else:
    print 'No'

Submission status: Runtime Error

Solution code:
def divisor(x):
  div = []
  for i in range(2,x/2+1):
    if (x%i==0):
      div.append(i)
  div.append(x)
  return div
     
if __name__ == '__main__':
  x, y = map(int, raw_input().split())
  #x = int(raw_input())
  #fac = factor(x)
  div = divisor(x)

  if y in div:
    print -1
  else:
    i = 2
    while True:
      tmp = i*x
      if (tmp%y != 0):
        print tmp
        exit(1)

Submission status: Runtime Error

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

if a%b == 0:
    print("-1")

else:
    print(X)

Submission status: Runtime Error

Solution code:
x,y = input().split(" ")
for i in range(y):
	if (x*i)%y == 0:
		print(x*i)
		break
else:
	print(-1)

Submission status: Runtime Error

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

sumA = 0
sumB = 0

for i in range(n):
    sumA = A[i] + sumA
    sumB = B[i] + sumB

if sumA <= sumB:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:

x, y =  map(int, input().split())
i = 1
if x % y == 0;
    print(-1)
else:
    for i in range(10 ** 18 + 1):
        if (i * x) % y != 0:
            print(i * x)
            break
        else:
            continue

Submission status: Runtime Error

Solution code:
x, y =  map(int, raw_input().split())

if x % y == 0;
    print(-1)
else:
    for i = 1 in range(10 ** 18 + 1):
        if i * x % y != 0:
            print(i * x)
            break
        else:
            continue

Submission status: Runtime Error

Solution code:
x, y =  map(int, raw_input().split())

if x < y:
    print(x)
else:
    print(x * (y-1) )

Submission status: Runtime Error

Solution code:
x, y =  map(int, raw_input().split())
z = 0
i = 1
a = 0

while z < 10 ** 18 or a ==  0:
    z = x * i
    i = i + 1
    if z mod y != 0:
        a = 1
print (z)

Submission status: Runtime Error

Solution code:

x, y =  map(int ,int)
z = 0
i = 1
a = 0

while z < 10 ** 18 or a =  0:
    z = x * i
    i = i + 1
    if z mod y != 0:
        a = 1

Submission status: Runtime Error

Solution code:
import sys

N = int(input())
 
A =[ [0 for i in range(2)]for i in range(20)]
 
if N < 20:
    for i in range(N):
 
        print(i)
        print("", flush=True)
    
    S = input()
    if S == 'Vacant':
        sys.exit()
 
else:
    nS = 0
    nE = N - 1
    nT = (N + 1) / 2
    nT2 = nT % 2
    if nT2 == 1:
        nT = nT + 1
    
    nQ = 0
    iTmp = 0
    nCnt = 0
 
    print(nQ)
    print("", flush=True)

    S = input()
    if S == 'Vacant':
        sys.exit()


    nQ = N - 1
    print(nQ)
    print("", flush=True)
    E = input()
    if E == 'Vacant':
        sys.exit()
 
    for i in range(19):
        nQ = ( nS + nE ) / 2
        print(nQ)
        print("", flush=True)
    
        S1 = input()
        if S1 == 'Vacant':
            sys.exit()
 
        nT2 = (nQ - nS) % 2

        if ( nT2 != 0 ) and ( S ==S1 ):
            E = S1
            nE = nQ
        elif ( nT2 == 0 ) and ( S !=S1 ):
            E = S1
            nE = nQ
        elif ( nT2 != 0 ) and ( S !=S1 ):
            S = S1
            nS = nQ
        elif ( nT2 == 0 ) and ( S ==S1 ):
            S = S1
            nS = nQ

Submission status: Runtime Error

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

X, Y = map(int, input().split())

for i in range(10**18 + 1):
    if i == 0:
        continue
    elif i == 10**18 + 1:
        print(-1)
    else:
        if i % X == 0 && i % Y != 0:
            print(i)
            break
        else:
            continue

Submission status: Runtime Error

Solution code:
x=int(input())
y=int(input())
if x%y != 0:
    print(x)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
import math

x=int(input())
y=int(input())
if x%y != 0:
    print(x)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
n = int(input())
numbersA = input().split()
numbersB = input().split()
diff = []
plusTotal = 0
minousTotal = 0

for i in range(0,n):
	diff.append((int(numbersB[i]) - int(numbersA[i])))
	if diff[i] < 0:
		minousTotal += diff[i]
	else:
		plusTotal += diff[i] // 2


print(plusTotal)

if plusTotal >= abs(minousTotal):
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
numbersA = input().split()
numbersB = input().split()
diff = []
plusTotal = 0
minousTotal = 0

for i in range(0,n):
	diff.append((int(numbersB[i]) - int(numbersA[i])))
	if diff[i] < 0:
		minousTotal += diff[i]
	else:
		plusTotal += diff[i] / 2


if plusTotal >= abs(minousTotal):
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = 0
for i in range(n):
    if a[i] - b[i] > 0:
        sum += a[i]- b[i]
    else:
        sum += (b[i] - a[i]) / 2
sum_a = 0
sum_b = 0
for i in range(n):
    sum_a += a.pop(0)
    sum_b += b.pop(0)
if sum <= sum_b - sum_a:
    print ('YES')
else:
    print ('NO')

Submission status: Runtime Error

Solution code:
print 'Yes'