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):
X,Y = (int(num) for num in input().split(" "))
flag = True
if X % Y == 0:
    flag = False
n = 2
while flag:
    if n * X % Y != 0:
        break
    if n * X > 10**18:
        flag = False
    n += 1

if flag:
    print(n * X)
else:
    print(-1)

Solution (Python):
a, b = input().split()
a = int(a)
b = int(b)
ans = -1
for i in range(1000000000000000000):
    if a % b == 0:
        break
    if a*i > 1000000000000000000:
        break
    if (a * i) % b != 0:
        ans = a * i
        break
print(ans)

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

    if not X % Y:
        print(-1)
    else:
        print(X)

main()

Solution (Python):
x,y = list(map(int,input().split()))
if x >= y and 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, Y):
        if (i * X) % Y != 0:
            print(i*X)
            break

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

Solution (Python):



from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

a, b = [int (i) for i in raw_input ().split ()]
l = a * b / g (a, b)
if l == a: print "-1"
elif l == 2 * a: print 3 * a
else: print 2 * a

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



if X == Y:
    print(-1)
    sys.exit()

for i in range(2,100):
    if int((X*i)/Y) != (X*i)/Y:
        print(X*i)
        sys.exit()
print(-1)

Solution (Python):
import random
import functools
import itertools
import math

R = lambda type_ = "int": list(map(eval(type_), input().split(' ')))

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

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

x, y = map(int, input().split())
d = gcd(x, y)
a = x // d
b = y // d

if (b == 1):
	print(-1)
else:
	print (a * (b - 1) * d)

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

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

if a == b:
    print(-1)
elif a > b and a%b == 0:
    print(-1)
else:
    x = a
    mult = 2
    fuck = False
    while (x * mult) % b == 0:
        mult = mult + 1
        if x * mult > 1e18:
            break
    if (x * mult)%b != 0 and x * mult <= 1e18:
        print(x*mult)
    else:
        print(-1)

Solution (Python):



import sys

x, y = map(int, sys.stdin.readline().strip().split(" "))
if x % y == 0:
    print(-1)
else:
    for i in range(1, y):
        if x * i % y > 0:
            print(x * i)
            break

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

Solution (Python):
if __name__ == "__main__":
    X, Y = map(int, input().strip().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)
    exit()
print(x)

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

if X % Y == 0:
    print(-1)
else:
    count = 2
    while True:
        cand = X * count
        if cand % Y != 0:
            print(cand)
            break
        elif 10**9 < cand:
            print(-1)
            break
        count += 1

Solution (Python):

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

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

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

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

ans = x
if ans % y  == 0: ans += y

print(-1 if ans % y == 0 or ans > 1e18 else 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())
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:
	ans=x
	while ans%y==0 and ans<=(10**18):
		ans+=x
	if ans<=10**18:
		print(ans)
	else:
		print(-1)

Solution (Python):
X, Y = [int(x) for x in 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 * Y - X)

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

Solution (Python):


import numpy as np

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

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

print ans

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

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

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