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 .

Solution (Python):
n,m = map(int, input().split())
if n % m == 0:
  print(-1)
else:
  print(n*(m+1))

Solution (Python):
a,c=map(int,input().split())
print((1+a)*(a%c>0)-1)

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

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):

def inputlist(): return [int(k) for k in input().split()]

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

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

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    x,y=map(int,input().split())
    if x==y or x%y==0:
        print(-1)
        sys.exit()
    else:
        for i in range(2,10*6):
            if x*i % y!=0:
                print(x*i)
                sys.exit()

if __name__=='__main__':
    main()

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

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

Solution (Python):
x,y=map(int,input().split())
i=x
l=False
if x==y or x%y==0:
    print(-1)
else:
    while 1<=i and i<=x*y:
        if i%x==0 and i%y!=0:
            print(i)
            l=True
            break
        else:
            i+=x

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

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

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

Solution (Python):
import math
x, y = map(int, input().split())
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

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

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

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

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

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

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

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

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

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

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

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

if __name__ == '__main__':
    main()

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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

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

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

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

print(-1)

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

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    x,y = LI()
    if x % y == 0:
        print(-1)
    else:
        print(x)
    return



if __name__ == '__main__':
    solve()

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

Solution (Python):
x, y = map(int, input().split())
if x == y or y == 1 or x % y == 0:
    print(-1)
    exit()
for i in range(1, 10**5):
    if x * i % y != 0:
        print(x*i)
        exit()

Solution (Python):
X,Y = map(int,input().split())
X_ = X
while X_ <= 10**9:
  if X == Y:
    print(-1)
    exit()
  X_ += X
  if X%Y != 0:
    print(X)
    exit()

print(-1)

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

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

Solution (Python):

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

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

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

Solution (Python):
import bisect
import heapq
import sys
import queue


input = sys.stdin.readline
sys.setrecursionlimit(100000)


class V:
    def __init__(self, f):
        self.f = f
        self.v = None

    def __str__(self):
        return str(self.v)

    def ud(self, n):
        if self.v is None:
            self.v = n
        else:
            self.v = self.f(self.v, n)

    def get(self):
        return self.v


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def main():
    X, Y = read_values()
    if X % Y == 0:
        print(-1)
    else:
        print(X * (Y + 1))


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
X, Y = map(int, input().split())
k = 1
if X % Y == 0:
    print(-1)
    exit()
while 1:
    if (k * X) % Y == 0:
        k += 1
    else:
        ans = k * X
        break
print(ans)

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

Solution (Python):
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

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x,y = iim()

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

Solution (Python):
X, Y = map(int, input().split())
if X % Y == 0:
    print(-1)
else:
    n = 1
    while True:
        if X*n % Y != 0:
            print(X*n)
            break
        else:
            n += 1

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

if a % b == 0:
    print(-1)
else:
    for i in range(1, a*b+1):
        if (a * i) % b != 0:
            print(a * i)
            break

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

Solution (Python):


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

result = 0

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


print(result)

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

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

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

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

if X%Y == 0:
  print(-1)
else:
  i = 2
  while True:
    if X*i > 10**18:
      print(-1)
      break
    if X*i%Y != 0:
      print(X*i)
      break
    i += 1

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


if __name__ == '__main__':
    main()

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

Solution (Python):
from fractions import gcd
X, Y = map(int, input().split())
if (gcd(X, Y) == Y):
    print(-1)
else:
    print(X)

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""


x,y = m()

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

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

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

Solution (Python):
from fractions import gcd
def main():
    x, y = map(int, input().split())
    if x % y == 0:
        print("-1")
    else:
        print(x)

if __name__ == "__main__":
    main()

Solution (Python):

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

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

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

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

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

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

if X % Y == 0:
    ans = -1
else:
    ans = X

print(ans)

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

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

print(ans)

Solution (Python):
from fractions import gcd
X,Y=map(int,input().split())


if (X/Y).is_integer()==True:
    print("-1")
else:
    print(X)

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

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

Solution (Python):

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

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

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

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

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

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

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

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

Solution (Python):
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)

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

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

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

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

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

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

Solution (Python):
import sys

use_clipboard=True

def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if sys.platform =='ios':
	if use_clipboard:
		ic=input_clipboard()
		input = lambda : ic.__next__()
	else:
		sys.stdin=open('inputFile.txt')


	


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

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

Solution (Python):
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)

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

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

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

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

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

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

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

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

Solution (Python):
from sys import stdin
import fractions

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

n,m = [int(x) for x in stdin.readline().rstrip().split()]

if lcm(n,m) == n:
    print(-1)
else:
    print(n)

Solution (Python):
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 == 0:
        print(-1)
    else:
        print(x)
    return

if __name__=='__main__':
    main()

Solution (Python):
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
    for i in range(1,4):
        if (x * i) % y != 0:
            print(x * i)
            return
    print(-1)
    return

if __name__=='__main__':
    main()

Solution (Python):
from fractions import gcd


def lcm(a, b):
    """
    aとbの最小公倍数を計算します。
    """
    return a * b // gcd(a, b)


X, Y = map(int, input().split())
a = lcm(X, Y)
if a == X:
    print(-1)
else:
    print(a - X)

Solution (Python):


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

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

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

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

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

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

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

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

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

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

ans = -1
for i in range((x*y)//fractions.gcd(x, y), 0, -x):
    if i%y != 0:
        ans = i
        break
print(ans)

Solution (Python):


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

result = -1

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

  n = (10 ** 18) // x

  for i in range(2, n+1) :
    m = x * i
    if (m % y) != 0 :
      result = m
      break

print(result)

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

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

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

Solution (Python):

 
import math
import itertools
import sys
import copy
 

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



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

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

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

Solution (Python):
x,y = [int(i) for i in input().split()]

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

Solution (Python):
X,Y = map(int,input().split())
if  X == Y:
  print(-1)
  exit()
if X > Y and X % Y == 0:
  print(-1)
  exit()
for x in range(X,10**18+1,X):
  if x % Y != 0:
    print(x)
    exit()

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

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

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

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

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

Solution (Python):
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)
    else:
        print(-1)


if __name__ == '__main__':
    solve()

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

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

i =2

if x < y :
	while x*i % y == 0:
		i = i + 1	
	print(x*i)
	
else:
	if x%y==0:
		print(-1)
	else:
		while x*i % y == 0:
			i = i + 1	
		print(x*i)

Solution (Python):
def main():
    X,Y = map(int,input().split())
    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()

Solution (Python):
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)

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

Solution (Python):
X,Y = map(int,input().split())
flag = -1
if X!=Y:
    for i in range(1,10**9//(X)+1):
        if i*X%Y!=0:
            flag = i*X
            break
print(flag)

Solution (Python):
def examA():
    X, Y = LI()
    ans = -1
    if X%Y!=0:
        ans = X
    print(ans)


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Solution (Python):
X, Y = map(int,input().split())
if (X/Y)%1 == 0:
    print(-1)
else:
    for i in range(10**6):
        if ((X*i)/Y)%1 != 0:
            print(X*i)
            break

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

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


main()

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

Solution (Python):
def main():
    X, Y = (int(i) for i in input().split())
    if X % Y == 0:
        print(-1)
    else:
        print(X)


if __name__ == '__main__':
    main()

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
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 X%Y==0:
        print(-1)
        exit()
    print(X)
    
if __name__ == '__main__':
    main()

Solution (Python):

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

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

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

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

Solution (Python):
X, Y = map(int, input().split())
num = 0
if X % Y == 0:
    print(-1)
else:
    while True:
        num += X
        if X % Y != 0:
            print(num)
            break

Solution (Python):
x, y = (int(i) for i in input().split())
if x%y == 0:
  print(-1)
else:
  print(x)

Solution (Python):
X,Y = (int(i) for i in input().split())

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

Solution (Python):
x, y = map(int, input().split())
if x > y:
    if x % y == 0:
        print(-1)
    else:
        print(x * 1)
elif x == y:
    print(-1)
elif x < y:
    print(x * 1)

Solution (Python):
x,y = map(int,input().split())
if x % y == 0:
    ans = -1
else:
    i = 1
    while i < y:
        if (i*x)%y != 0:
            ans = i*x
            break
print(ans)

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

Solution (Python):

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

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

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

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

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

Solution (Python):

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

Solution (Python):

X,Y = map(int, input().split())
if X % Y == 0:
    print(-1)
else:
    for i in range (10**9+1):
        if (X*i) % Y != 0:
            print(X*i)
            break

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

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

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10000)
INF = 1<<32


def solve(X: int, Y: int):
    print(-1) if X%Y == 0 else print(X)
        
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    Y = int(next(tokens))  
    solve(X, Y)

if __name__ == '__main__':
    main()

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


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

    main(x, y)

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

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

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

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

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

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

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

Solution (Python):
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    x, y = list(map(int, input().rstrip('\n').split()))
    d = collections.defaultdict(list)
    if x % y == 0:
        print(-1)
    else:
        print(x)


if __name__ == '__main__':
    slove()

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

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

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