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:
#coding:utf-8
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)

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
    elif i%x==0 and i%y!=0:
        print(i)
        a=1
        break
if a==0:
    print(-1)

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==0 and i%y!=0:
        print(i)
        a=1
        break
if a==0:
    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())

ans = -1
if x==y:
    print(-1)
else:
    x *= 2
    while x <= 10**18:
        if x % y == 0:
            x *= x
        else:
            ans = x
            break
    print(x)

Submission status: Wrong Answer

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

print(num)

Submission status: Wrong Answer

Solution code:
import sys
import math
import fractions
import bisect
import queue
import heapq
from collections import deque
sys.setrecursionlimit(4100000)

MOD = int(1e9+7)
PI = 3.14159265358979323846264338327950288
INF = 1e18

'''
1行のint
N, K = map(int, input().split())

1行のstring
S, T = input().split()

1行の整数配列
P = list(map(int,input().split()))

改行あり整数
x = []
y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)

N行M列の初期化
dp = [[INF] * M for i in range(N)]

'''


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

Submission status: Wrong Answer

Solution code:
import sys
import math
import fractions
import bisect
import queue
import heapq
from collections import deque
sys.setrecursionlimit(4100000)

MOD = int(1e9+7)
PI = 3.14159265358979323846264338327950288
INF = 1e18

'''
1行のint
N, K = map(int, input().split())

1行のstring
S, T = input().split()

1行の整数配列
P = list(map(int,input().split()))

改行あり整数
x = []
y = []
for i in range(N):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)

N行M列の初期化
dp = [[INF] * M for i in range(N)]

'''


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B = map(int,input().split())
if(A % B == 0 or B % A == 0):
	print(-1)
	exit()
else:
	flag = False
	cnt = 2
	while True:
		if A * cnt % B != 0:
			break
		cnt+=1
print(A * cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if x==y:
  print(-1)
elif y==1:
  print(-1)
else:
  for i in range(1,10**10):
    if x*i<=10**18:
      break
    elif x*i%y !=0:
      print(x*i)
      break

Submission status: Wrong Answer

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

val =fractions.gcd(x, y)

if val == x:
  print(-1)
else:
  print(x*val)

Submission status: Wrong Answer

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())
    if y % x == 0:
        print(-1)
    else:
        print(x)
    return

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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())
    if x == y:
        print(-1)
        return
    if y % x == 0:
        mul = y // x + 1
        print(x * mul)
        return
    if (x * 2) % y != 0:
        print(x * 2)
        return
    print(-1)
    return

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

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())
    if (x * 2) % y == 0:
        print(-1)
    else:
        print(x * 2)
    return

if __name__=='__main__':
    main()

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)
    exit(0)
i = 2
while X * i <=10 ** 18:
    if X * i % Y != 0:
        print(X * i)
        exit(0)
print(-1)

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:
x,y=map(int,input().split())
if(x%y==0 or y%x==0):
    print('-1')
else:
    for i in range(1, 1000000):
        if(x*i%y != 0):
            print(x*i)
            break

Submission status: Wrong Answer

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

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

if Y % X == 0 or X>10**18:
    print(-1)
else:
    print(X)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a==b or b==1:
  print(-1)
else:
  print(a*(b+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())
num = X
while num <= 10**8:
  if num%Y != 0:
    print(num)
    exit()
  num += X
print(-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 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 X % Y == 0 :
   print( -1 )
else :
   print( X )

Submission status: Wrong Answer

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    x, y = list(map(int, readline().split()))
    if x % y != 0:
        print(x)
    elif y % x != 0:
        print(y)
    else:
        print(-1)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
x,y=map(int,input().split())
if x<y:
    print(x)
    exit()

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

temp = gcd(x,y)

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

Submission status: Wrong Answer

Solution code:
x, y = map(int,input().split())
Answer = -1
def division(x):
  output = []
  for i in range(x//2):
    if x % (i+1) == 0:
      output.append(i+1)
  return output
x_div = division(x)
y_div = division(y)

if (x-1)*(y-1) == 0:
  Answer = -1
elif len(set(y_div) - set(x_div)) == 0:
  Answer = -1

else:
  Answer = (sorted(list(set(y_div) -set(x_div)))[0]-1)*x

print(Answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from fractions import gcd


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


def main():
    X, Y = map(int, input().split())
    m = lcm(X, Y)
    if X == Y:
        print('-1')
    elif m > 10**18:
        print(X)
    else:
        print(X * (Y - 1))


main()

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    X,Y=MI()
    if Y%X==0:
        print(-1)
        exit()
    print(X)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# APC 001: A – Two Integers
x, y = [int(s) for s in input().split()]
print(-1 if x % y == 0 else x * 2)

Submission status: Wrong Answer

Solution code:
# APC 001: A – Two Integers
x, y = [int(s) for s in input().split()]

if x % y == 0:
    print(-1)
else:
    for i in range(1, y + 1):
        if (x * i) % y != 0 and x * i > x:
            print(x * i)
            break
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
# APC 001: A – Two Integers
x, y = [int(s) for s in input().split()]

for i in range(1, y + 1):
    if (x * i) % y != 0 and x * i > x:
        print(x * i)
        break
else:
    print(-1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if x >= y and 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)

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)

Submission status: Wrong Answer

Solution code:
'''A - Two Integers
https://atcoder.jp/contests/apc001/tasks/apc001_a

>>> main(8, 6)
16
>>> main(3, 3)
-1

'''


def main(x, y):
    if x % y == 0:
        print(-1)
    else:
        print(x * 2)


if __name__ == '__main__':
    x, y = map(int, input().split(' '))
    main(x, y)

Submission status: Wrong Answer

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

for i in range(2, 10 ** 18 + 1):
    ans = i * X
    if ans % Y != 0:
        print(ans)
        sys.exit()

Submission status: Wrong Answer

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

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

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

    if x * 2 < x * (y//gcd(x, y)):
        print(x*2)
    else:
        print(-1)
    


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import fractions as 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: Wrong Answer

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


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    x, y = map(int, input().split())
    if x <= y and x % y == 0:
        print(-1)
    else:
        for i in range(2, 10 ** 5):
            if x * i > 10 ** 18:
                print(-1)
                return 0
            if (x * i) // y:
                print(x * i)
                return 0


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    x, y = map(int, input().split())
    if x % y == 0:
        print(-1)
    else:
        for i in range(2, 10 ** 5):
            if x * i > 10 ** 18:
                print(-1)
                return 0
            if (x * i) // y:
                print(x * i)
                return 0


if __name__ == "__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:
from fractions import gcd
x,y=map(int,input().split())

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

Submission status: Wrong Answer

Solution code:
def gcd(a, b):
    """a, bの最大公約数(greatest common divisor:GCD)を求める"""
    if b == 0:
        return a
    return gcd(b, a%b)


a, b = map(int,input().split())
gcd_ab = gcd(a, b)
if gcd_ab == b:
    print(-1)
else:
    print(a*gcd_ab)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from fractions import gcd

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

i=1

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

if Y//gcd(X,Y)==1:
    print(-1)
else:
    print((X*(Y//gcd(X,Y)-1)))

Submission status: Wrong Answer

Solution code:
from fractions import gcd

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

i=1

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

if Y//gcd(X,Y)==1:
    print(-1)
else:
    print((X*(Y//gcd(X,Y)-1)))

Submission status: Wrong Answer

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

i=1

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

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

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())
if x ==y:
  print(-1)
else:
  print(x)

Submission status: Wrong Answer

Solution code:
x,y = map(int, input().split())
ans =0
if x !=y:
  for i in range(20):
    if i%x ==0 and i%y!=0:
      ans =i
elif x ==y:
  ans =-1
print(ans)

Submission status: Wrong Answer

Solution code:
def main():

    X, Y = map(int, input().split())
    if Y % X == 0:
        return -1

    a = X
    while True:
        if a % Y != 0:
            return a
        a += X

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

max_num = 10 ** 18
ans = -1

for i in range(X, max_num+1, X):
  if i % Y == 0:
    ans = i
    break
  
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if y == 1:
  print(-1)
  exit()

for i in range(1, y):
  if x * i <= 10 ** 18:
    print(x*i)
    exit()

print(-1)

Submission status: Wrong Answer

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

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

for i in range(2, y):
  if x * i <= 10 ** 18:
    print(x*i)
    exit()

print(-1)

Submission status: Wrong Answer

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

if x * y < 10 ** 18:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

main()

Submission status: Wrong Answer

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

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

main()

Submission status: Wrong Answer

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

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

main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def solve(x, y):
    if y % x != 0:
        return x
    else:
        q = y // x
        r = (q+1) * x
        if r % q == 0:
            return r
        else:
            return -1
x, y = map(int, input().split())
print(solve(x, y))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import fractions

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

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

Submission status: Wrong Answer

Solution code:
import fractions

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

if a > b:
    a,b = b,a

s = fractions.gcd(a,b)

t = (a*b)//s

if t == a or t == b:
    print(-1)
    
else:
    if a * 2 != b and a*2 <= 10**18:
        print(a*2)
    elif a*3 != b and a*3 <= 10**18:
        print(a*3)
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
import fractions

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

s = fractions.gcd(a,b)

t = (a*b)//s

if t == a or t == b:
    print(-1)
    
else:
    if a * 2 != b and a*2 <= 10**18:
        print(a*2)
    elif a*3 != b and a*3 <= 10**18:
        print(a*3)
    else:
        print(-1)

Submission status: Wrong Answer

Solution code:
import fractions

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

s = fractions.gcd(a,b)

t = (a*b)//s

if t == a or t == b:
    print(-1)
else:
    if a * 2 != b:
        print(a*2)
    else:
        print(a*3)

Submission status: Wrong Answer

Solution code:
import fractions

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

s = fractions.gcd(a,b)

t = (a*b)//s

if t == a or t == b:
    print(-1)
else:
    print(a*2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X,Y=map(int,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: Wrong Answer

Solution code:
X,Y=map(int,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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
import fractions
g = fractions.gcd(x,y)
if x == y:
    print(-1)
elif y == 1:
    print(-1)
elif x > y and y == g:
    print(-1)
elif x < y:
    print(x)
elif x % y == 0:
    print(-1)
else:
    print(x*g)

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
import fractions
g = fractions.gcd(x,y)
if x == y:
    print(-1)
elif y == 1:
    print(-1)
elif x > y and y == g:
    print(-1)
elif x < y:
    print(x)
else:
    print(x*g)

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
import fractions
g = fractions.gcd(x,y)
if x == y:
    print(-1)
elif y == 1:
    print(-1)
elif x > y and y == g:
    print(-1)
else:
    print(x*g)

Submission status: Wrong Answer

Solution code:
x,y = map(int,input().split())
num = x*2
rate = 2
while num < 10**18:
    if num % y != 0:
        print(num)
        break
    else:
        rate += 1
        num *= rate
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
def abc():
    x, y = map(int, input().rstrip().split())
    if x % y == 0 or y % x == 0:
        print(-1)
        return
    for i in range(2, 10 ** 9 + 1):
        if x * i % y:
            print(x * i)
            return


abc()

Submission status: Wrong Answer

Solution code:
def abc():
    x, y = map(int, input().rstrip().split())
    if x % y == 0 or y % x == 0:
        print(-1)
        return
    for i in range(1, 10 ** 9 + 1):
        if x * i % y:
            print(x * i)
            return


abc()

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) or (Y % X == 0):
    print(-1)
else:
    print(X)

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 * (Y - 1))

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 * 2)

Submission status: Wrong Answer

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

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:
# APC001A - Two Integers
from fractions import gcd

x, y = list(map(int, input().rstrip().split()))
if gcd(x, y) in (x, y):
    print(-1)
else:
    print(x)

Submission status: Wrong Answer

Solution code:
# APC001A - Two Integers
from fractions import gcd

x, y = list(map(int, input().rstrip().split()))
if gcd(x, y) in (x, y):
    print(-1)
else:
    i = 2
    while True:
        if x * i % y != 0:
            print(x * i)
            break
        i += 1

Submission status: Wrong Answer

Solution code:
# APC001A - Two Integers
from fractions import gcd

x, y = list(map(int, input().rstrip().split()))
g = gcd(x, y)
if g in (x, y):
    print(-1)
else:
    print(x * g)

Submission status: Wrong Answer

Solution code:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

X, Y = mi()

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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