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: Wrong Answer

Solution code:
x,y = map(int,input().split())
if x == y:
  print(-1)
else:
  for i in range(1,10000000):
    a = i * x
    if a % y != 0:
      print(a)
      exit()

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
if x == y:
  print(-1)
else:
  for i in range(1,10000):
    a = i * x
    if a % y != 0:
      print(a)
      exit()

Submission status: Wrong Answer

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

XY = []
XY.append(X)
XY.append(Y)

XY.sort()

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

Submission status: Wrong Answer

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

XY = []
XY.append(X)
XY.append(Y)

XY.sort()

if XY[1]%XY[0] == 0:
  print("-1")
  
else:
  print(X*(Y+1))

Submission status: Wrong Answer

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

XY = []
XY.append(X)
XY.append(Y)

XY.sort()

if XY[1]%XY[0] == 0:
  print("-1")
  
else:
  print(X*(Y-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
print(x*y+x if x!=y else -1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
for i in range(10**18):
    if i != a:
        if i%8 == 0 and i%6 != 0:
            print(i)
            break
    if a == b:
        print(-1)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if y == 1:
  print(-1)
else:
  if 0 < x and x <= 1e18:
    print(x)
  else :
    print(-1)

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
ans=-1
if X%Y==0:
    pass
else:
    for i in range(100):
        if X*i%Y!=0:
            ans=X*Y
            break
print(ans)

Submission status: Wrong Answer

Solution code:
def LI():
    return list(map(int, input().split()))


X, Y = LI()
if X == Y:
    ans = -1
elif X*2 == Y:
    ans = X*3
else:
    ans = X*2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X,Y = map(int, input().split())
if X%Y==0:
    print(-1)
    exit()
for i in range(2,10**18):
    X=X*i
    if X>10**18:
        print(-1)
        exit()

    if X%Y != 0:
        print(X)
        exit()
    X=X/i

Submission status: Wrong Answer

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

for i in range(2,10**18):
    X=X*i
    if X>10**18:
        print(-1)
        exit()

    if X%Y != 0:
        print(X)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    X, Y = [int(i) for i in input().split()]
    if Y % X == 0:
        print(-1)
    else:
        print(X)

resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    X, Y = [int(i) for i in input().split()]
    if max(X, Y) % min(X, Y) == 0:
        print(-1)
        return
    tmp = X
    while tmp % Y == 0 and tmp <= 10**18:
        tmp += X
    if tmp <= 10**18:
        print(tmp)
    else:
        print(-1)

resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections
import math


def main():
    x, y = map(int, input().split())

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import collections
import math


def main():
    x, y = map(int, input().split())

    if x % y == 0 or y % x == 0:
        print(-1)
        return
    print(x)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import collections
import math


def main():
    x, y = map(int, input().split())

    if x % y == 0 or y % x == 0:
        print(-1)
        return

    k = x * y // math.gcd(x, y)
    print(k - x)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import math

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    X, Y = map(int, readline().split())
    x = X
    if Y%X==0:
        print(-1)
    else:
        print(X)



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import math

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    X, Y = map(int, readline().split())
    x = X
    if Y%X==0:
        print(-1)
    else:
        while True:
            if X%Y!=0:
                print(X)
                break
            else:
                X += x



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
    if a%b==0:
        return b
    return gcd(b,a%b)

def check(n,m):
    x,y = max(n,m), min(n,m)
    sol = gcd(x,y)
    if sol == n:
        d = x//y
        if d!=1:
            return n*(d+1)
        else:
            return -1
    elif sol == m:
        return -1
    else:
        return n*(x//y+1)

n,m = map(int, input().split())
c, limit = check(n,m), pow(10,9)
print(-1 if c>limit else c)

Submission status: Wrong Answer

Solution code:
X,Y=map(int,input().split())
for i in range(2,Y):
  if X*i%Y!=0:
    print(X*i)
    exit()
print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if x == y:
    print(-1)
else:
    print(x)

Submission status: Wrong Answer

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

if x == y:
    print(-1)
else:
    print(x*(y+1))

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split());ans=0
if x==y:
  print(-1)
else:
  for i in range(2,(x*y//min(x,y))+1):
    if (x*i)%y!=0:
      print(x*i)
      break

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split());ans=0
if x==y:
  print(-1)
else:
  for i in range(2,(x*y//min(x,y))+1):
    if x*i%y!=0:
      print(x*i)
      break

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
ans = -1
for i in range(1, 4):
  if a * i % b == 0:
    ans = a * i
print(ans)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())
print(a if a != b else '=1')

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
import math
if X % Y == 0:
  ans = -1
elif Y % X == 0:
  ans = X * math.gcd(X, Y)
else:
  ans = X
if ans > 10**18:
  ans = -1
if X == 1 and Y != 1:
  ans = Y + 1
print(ans)

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
if Y % X == 0 or X % Y == 0:
  ans = -1
else:
  ans = X
if ans > 10**18:
  ans = -1
if X == 1 and Y != 1:
  ans = Y + 1
print(ans)

Submission status: Wrong Answer

Solution code:
X, Y = map(int, input().split())
if Y % X == 0 or X % Y == 0:
  ans = -1
else:
  ans = X
if ans > 10**18:
  ans = -1
if X == 1:
  ans = Y + 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
if X%Y==0:
    print(-1)
else:
    x = X
    y = Y
    while y>0:
        x,y = y,x%y
    a = x
    m = X//a
    print(a**2*m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())
if x == y: print(-1)
else:
    print(min(x,y)*2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    import math
    X, Y = map(int, input().split())
    if X == Y:
        print("-1")
    else:
        for i in range(2, X):
            if X%i == 0 and X*i%Y != 0:
                print(X*i)
                exit()
        print("-1")
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i=input()
print((i[0],-1)[eval(i.replace(' ','=='))])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if x == y:
    print(-1)
else:
    print(abs(x-y) * x)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

else:
    for i in range(1,10000000):
        z = x*i
        if z%y != 0:
            print(z)
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    X, Y = map(int, input().split())
    if X == Y:
        print(-1)
    else:
        for i in range(2,10**1):
            if X*i%Y != 0:
                print(X*i)
                exit()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
if x==y:
  print(-1)
else:
  for i in range(1,1000000):
    s=x*i
    if s%y!=0:
      print(s)
      exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if X % Y == 0:
    print(-1)
else:
    for i in range(10**18):
        X1 = int(X*i)
        if X1 % Y != 0:
            print(X1)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if X % Y == 0:
    print(-1)
else:
    for i in range(10**18):
        X1 = int(X*i)
        if X1 % Y != 0:
            print(str(X1))
        break

Submission status: Wrong Answer

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

if X == Y or X % Y == 0:
    print(-1)
else:
    for i in range(10**18):
        X1 = int(X*i)
        if X1 % Y != 0:
            print(str(X1))
        break

Submission status: Wrong Answer

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

if X==Y:
    print(-1)
else:
    if X % 2 != 0 and Y % 2 != 0 :
        print(str(X))
    else:
        for i in range(10**18):
            X1 = int(X*i)
            if X1 % Y != 0:
             print(str(X1))
             break

Submission status: Wrong Answer

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

if X==Y:
    print(-1)
else:
    for i in range(10**18):
        X1 = int(X*i+1)
        if X1 % Y != 0:
            print(str(X1))
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
if (x*10)%y != 0:
    print(x*10)

Submission status: Wrong Answer

Solution code:
import random
x,y=map(int,input().split())
if (x*random.randint(1,9))%y != 0:
    print(x*random.randint(1,9))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        x,y=map(int,input().split())
        if y%x==0:
            return -1
        else:
            for i in range(1,10**18+1):
                if i%x==0 and i%y!=0:
                    return i
    print(main())
resolve()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    def main():
        x,y=map(int,input().split())
        if y%x==0:
            return -1
        else:
            i=1
            while True:
                if i*x%y!=0:
                    return i*x
                    break    
    print(main())
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())
if x!= y and min(x,y) == x: print(x)
elif x%y == 0: print(-1)
else:
  for i in range(1, 10**9//x):
    if (x ** i) % y != 0: 
      print(x**i)
      exit()

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())
if x!= y and min(x,y) == x: print(x)
elif x%y == 0: print(-1)
else:
  for i in range(1, 10**9//x):
    if x ** i % y != 0: 
      print(x**i)
      exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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**18:
    while y*b < x*a:
      b += 1
    if y*b != x*a:
      return (x*a, y*b)
    a += 1
  return (-1,-1)

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

Submission status: Wrong Answer

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**18:
    while y*b < x*a:
      b += 1
    if y*b != x*a:
      return (x*a, y*b)
    a += 1
  return (-1,-1)

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

Submission status: Wrong Answer

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,-1)

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

Submission status: Wrong Answer

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,-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    x,y=map(int,input().split())
    if x==y or y%x==0:
        print(-1)
        sys.exit()
    else:
        print(x)

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num1, num2 = input().split(' ')

num1 = int(num1)
num2 = int(num2)

endless = 10**9


def get_result(num1, num2):
    mul_num1 = num1
    mul_num2 = num2
    result = -1

    if(num1 == num2):
        print(-1)
        return
    else:
        for i in range(2, endless):
            mul_num1 = i*num1
            while(mul_num1 >= mul_num2 and mul_num1 * mul_num2 <= 10**18):
                if(mul_num1 != mul_num2):
                    result = mul_num1
                    print('Same!!!', mul_num1)
                    return
                mul_num2 = mul_num2 + num2
    # if no such number exists
    print(-1)
    return


get_result(num1, num2)

Submission status: Wrong Answer

Solution code:
num1, num2 = input().split(' ')

num1 = int(num1)
num2 = int(num2)

# mul_num stores the current values of multiples of num, to avoid extra calculation


endless = 100


# ensure num1 >= num2
if (num1 < num2):
    temp = num1
    num1 = num2
    num2 = temp


def get_result(num1, num2):
    mul_num1 = num1
    mul_num2 = num2
    result = -1
    index2 = 1
    for i in range(2, endless):
        mul_num1 = i*num1
        while(mul_num1 >= mul_num2 and index2 <= endless):
            if(mul_num1 != mul_num2):
                result = mul_num1
                print('Same!!!', mul_num1)
                return
            index2 = index2 + 1
            mul_num2 = num2*index2


get_result(num1, num2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 test(x, y):
    for index in range(math.floor(y/x), abs(y)):
        if (x * index % y != 0 and abs(x * index) <= 10**(18)):
            return x * index
    return -1
print(test(x,y))

Submission status: Wrong Answer

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 test(x, y):
    for index in range(-abs(y), abs(y) + 1):
        if (x * index % y != 0 and abs(x * index) <= 10**(18)):
            return x * index
    return -1
print(test(x,y))

Submission status: Wrong Answer

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 test(x, y):
    for index in range(2, y + 1):
        if (x * index % y != 0):
            return x * index
    return -1
print(test(x,y))

Submission status: Wrong Answer

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 test(x, y):
    for index in range(2, x+1):
        if (x * index % y != 0):
            return x * index
    return -1
print(test(x,y))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    if Y % X == 0:
        print("-1")
    else:
        print(X)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if X%Y==0 or Y%X==0:
    print(-1)
    exit()

while X<=10**18:
    if X*i%Y != 0:
        print(X*i)
        exit()
    else:
        i += 1

print(-1)

Submission status: Wrong Answer

Solution code:
from sys import exit
X, Y = map(int,input().split())
if X % Y == 0 or Y % X == 0:pass
else:
  for i in range(X,10 ** 18 + 1,X):
    if i % Y != 0:
      print(i)
      exit()
print(-1)

Submission status: Wrong Answer

Solution code:
from sys import exit
X, Y = map(int,input().split())
if X % Y == 0 or Y % X == 0: pass
else:
  for i in range(10 ** 18 + 1):
    if i % X == 0 and i % Y != 0:
      print(i)
      exit()
print(-1)

Submission status: Wrong Answer

Solution code:
from sys import exit
X, Y = map(int,input().split())
if X % Y == 0 or Y % X == 0: print(-1)
else:
  for i in range(X,10 ** 18 + 1,X):
    if i % Y != 0:
      print(i)
      exit()
print(-1)

Submission status: Wrong Answer

Solution code:
from sys import exit
X, Y = map(int,input().split())
if X % Y == 0 or Y % X == 0: print(-1)
else:
  for i in range(10 ** 18 + 1):
    if i % X == 0 and i % Y != 0:
      print(i)
      exit()
print(-1)

Submission status: Wrong Answer

Solution code:
from sys import exit
X, Y = map(int,input().split())
if X % Y == 0 or Y % X == 0: print(-1)
else:
  for i in range(X,10 ** 18 + 1,X):
    if i % Y != 0:
      print(i)
      exit()

Submission status: Wrong Answer

Solution code:
from sys import exit
X, Y = map(int,input().split())
if X % Y == 0 or Y % X == 0: print(-1)
else:
  for i in range(10 ** 18 + 1):
    if i % X == 0 and i % Y != 0:
      print(i)
      exit()

Submission status: Wrong Answer

Solution code:
X,Y = map(int,input().split())
while X < 10**18:
  X *= 2
  if X%Y != 0:
    print(X)
    exit()
  else:
    continue
print(-1)

Submission status: Wrong Answer

Solution code:
from functools import reduce
from fractions import gcd

def lcm_base(x, y):
    return (x * y) // 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)//Y > 10**18 or X == Y:
  print(-1)
else:
  print(lcm(X,Y)//Y)

Submission status: Wrong Answer

Solution code:
from functools import reduce
from fractions import gcd

def lcm_base(x, y):
    return (x * y) // 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: Wrong Answer

Solution code:
# APC 001: A – Two Integers
x, y = map(int, input().split())
print('-1' if x % y == 0 else x * y)

Submission status: Wrong Answer

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

if X%Y==0:
  ans=-1
else:
  for i in range(1,(10**18)//X+1):
    if i*X%Y!=0:
      print(i*X)
      break

Submission status: Wrong Answer

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

if X%Y==0:
  ans=-1
else:
  print(X*(Y-1))

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

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

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    for i in range(1,100000002):
        if a[0] // a[1]==0:
            print(-1)
            break

        if i ==10**9+1:
            print(-1)
            break
        if a[0]*i %a[1] >0:
            print(a[0]*i)
            break
        if a[0]*i >10**18 +1:
            print(-1)
            break

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

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

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    for i in range(1,100000002):
        if a[0] // a[1]==0:
            print(-1)
            break

        if i ==1000001:
            print(-1)
            break
        if a[0]*i %a[1] >0:
            print(a[0]*i)
            break
        if a[0]*i >100000000000000001:
            print(-1)
            break

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

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

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    for i in range(1,10000000002):
        if a[0] // a[1]==0:
            print(-1)
            break
        
        if i ==10000000001:
            print(-1)
            break
        if a[0]*i %a[1] >0:
            print(a[0]*i)
            break
        if a[0]*i >10000000001:
            print(-1)
            break

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

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

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    for i in range(1,10000000002):
        if i ==10000000001:
            print(-1)
            break
        if a[0]*i %a[1] >0:
            print(a[0]*i)
            break
        if a[0]*i >10000000001:
            print(a[0]*i)
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 8 = 2 * 2 * 2
# 6 = 2 * 3
x,y= map(int,(input().split()))

result = 0

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


print(result)

Submission status: Wrong Answer

Solution code:

X,Y  = map(int, input().split())
if X > Y:
    print(X)
elif X == Y:
    print(-1)
else:
    if Y % X == 0:
        print(-1)
    else:
        print(X)

Submission status: Wrong Answer

Solution code:
a  = sorted(list(map(int, input().split())))
X = a[0]
Y = a[1]
if Y == X: print(-1)
else:print(X)

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
a=0
for i in range(min(x,y),max(x,y)):
    if x%y==0 or y%x==0:
        print(-1)
        a=1
        break
    if (i*x)%y!=0:
        print(i*x)
        a=1
        break
if a==0:
    print(-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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