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: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

X,Y = IL()

if X%Y==0:
  print(-1)
else:
  for i in range(1,Y):
    if X*i%Y:
      print(X*i)
      exit()

Submission status: Accepted

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
x,y = readInts()
if x % y == 0:
    print(-1)
    exit()
while x <= 10**18:
    if x % y != 0:
        print(x)
        exit()
    x += x
print(-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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

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

    for res in range(x, 10 ** 18, x):
        if res % y:
            print(res)
            break


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if a % b == 0:
  print(-1)
else:
  for i in range(10**9):
    if (a * i) % b != 0:
      print(a * i)
      exit()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(1,100000000):
    ans1 = temp[0]*i
    if ans1 % temp[1] != 0:
        break
    if ans1 >= 10^18:
        ans1 = -1
        break
print(ans1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
X,Y=map(int,input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
x, y = map(int, input().split())

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

ans = x
while ans<=10**18:
    if x%y!=0:
        print(x)
        exit()
    else:
        ans+=x

Submission status: Accepted

Solution code:
def divisors(n):
    d=[]
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            d.append(i)
            if i!=n//i:
                d.append(n//i)
    d.sort()
    return d

x,y=map(int,input().split())
print(-1 if y in divisors(x) else x)

Submission status: Accepted

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

# A - Two Integers
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
		else:
			i += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    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
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#template
def inputlist(): return [int(k) for k in input().split()]
#template
X,Y = inputlist()
if X % Y == 0:
    print(-1)
else:
    print(X)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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

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


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

Solution code:
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))

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

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 


print(result)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    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): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
x, y = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
from fractions import gcd
X,Y=map(int,input().split())
#n=X*Y/pow(gcd(X,Y),2)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

if __name__=='__main__':
    main()