Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    i = 0
    N = int(input())
    if N-90>0:
        i = 1
    x = (N-9)/10
    if x == int(x):
        i = 1
    if i == 1:
        print(Yes)
    else:
        print(No)

Fixed submission:
if __name__ == '__main__':
    i = 0
    N = int(input())
    if N-90>0:
        i = 1
    x = (N-9)/10
    if x == int(x):
        i = 1
    if i == 1:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    N = int(input())
    if N-90>0:
        i = 1
    x = (N-9)/10
    if x == int(x):
        i = 1
    if i == 1:
        print(Yes)
    else:
        print(No)

Fixed submission:
if __name__ == '__main__':
    i = 0
    N = int(input())
    if N-90>0:
        i = 1
    x = (N-9)/10
    if x == int(x):
        i = 1
    if i == 1:
        print('Yes')
    else:
        print('No')

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    N = int(input())
    if N-90>0:
        print(Yes)
        return
    x = (N-9)/10
    if x == int(x):
        print(Yes)
        return
    print(No)

Fixed submission:
if __name__ == '__main__':
    i = 0
    N = int(input())
    if N-90>0:
        i = 1
    x = (N-9)/10
    if x == int(x):
        i = 1
    if i == 1:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    N = int(input())
    ans = 0
    for i in range(N):
        l = list(map(int, input().split()))
        ans += abs(l[1]-l[0])
    print(ans

Fixed submission:
if __name__ == '__main__':
    N = int(input())
    ans = 0
    for i in range(N):
        l = list(map(int, input().split()))
        ans += abs(l[1]-l[0]+1)
    print(ans)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    X, t = map(int, raw_input().split())
    rt = X-t
    if re>0:
        print(re)
    else:
        print(0)

Fixed submission:
if __name__ == '__main__':
    X, t = map(int, input().split())
    re = X-t
    if re>0:
        print(re)
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    x, a, b = int(input())
    if abs(x-a) < abs(x-b):
        print('A')
    else:
        print('B')

Fixed submission:
if __name__ == '__main__':
    x, a, b = map(int, input().split())
    if abs(x-a) < abs(x-b):
        print('A')
    else:
        print('B')
Buggy python submission (verdict: Runtime Error):
if __name__ = '__main__':
    S = input()
    dic = [chr(i) for i in range(97, 123)]
    for i in range(len(dic)):
        if dic[i] not in S:
            print(dic[i])
            return

Fixed submission:
if __name__ == '__main__':
    S = input()
    dic = [chr(i) for i in range(97, 123)]
    j=0
    for i in range(len(dic)):
        if dic[i] not in S:
            j = 1
            print(dic[i])
            break
    if j == 0:
        print('None')
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    A, B, C, D = map(int, input().split())

    if B <= C or D <= A:
        print(0)
    else:
        if A < C:
            print(B-C)
        elif A > C
            print(D - A)
        else:
            if B < D:
                print(B-A)
            else:
                print(D-A)

Fixed submission:
if __name__ == '__main__':
    A, B, C, D = map(int, input().split())

    if B <= C or D <= A:
        print(0)
    else:
        if A < C:
            if B < D:
                print(B-C)
            else:
                print(D-C)
        elif A > C:
            if B < D:
                print(B-A)
            else:
                print(D-A)
        else:
            if B < D:
                print(B-A)
            else:
                print(D-A)

Buggy python submission (verdict: Runtime Error):
if __name == '__main__':
    A, B, C, D = map(int, input().split())

    if B =< C or D =< A:
        print(0)
    else:
        if A < C:
            print(B-C)
        else:
            print(D - A)

Fixed submission:
if __name__ == '__main__':
    A, B, C, D = map(int, input().split())

    if B <= C or D <= A:
        print(0)
    else:
        if A < C:
            if B < D:
                print(B-C)
            else:
                print(D-C)
        elif A > C:
            if B < D:
                print(B-A)
            else:
                print(D-A)
        else:
            if B < D:
                print(B-A)
            else:
                print(D-A)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8

A, B = map(int,raw_input().split())
S = raw_input()

if S[A] != '-':
    print "No"

elif (A != 0) and (S[0:A] in "-"):
    print "No"

elif (B != 0) and (S[A+1:len(S)] in "-"):
    print "No"

else:
    print "Yes"


Fixed submission:
#coding:utf-8

now = int(raw_input())

time = 48 - now

print time
Buggy python submission (verdict: Runtime Error):
#coding:utf-8

A, B = map(int,raw_input().split())
S = raw_input()

if S[A] != '-':
    print "No"

else:
    Flag = 0
    for i in range(A):
        if S[i] >= '0' and S[i] <= '9':
            Flag = 1
    for i in range(A+1,len(S)):
        if S[i] >= '0' and S[i] <= '9':
            Flag = 1

if Flag == 1:
    print "No"
else:
    print "Yes"


Fixed submission:
#coding:utf-8

A, B = map(int,raw_input().split())
S = raw_input()

if S[A] != '-':
    print "No"

else:
    Flag = 0
    for i in range(A):
        if (S[i] >= '0' and S[i] <= '9') == False:
            Flag = 1
            #print "hello1"
    for i in range(A+1,len(S)):
        if (S[i] >= '0' and S[i] <= '9') == False:
            Flag = 1

    if Flag == 1:
        print "No"
    else:
        print "Yes"
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
str=[]
p=1
for i in range(k):
    for j in range(0,len(s)-i):
        str.append(s[j:j+i+1])
        str=list(set(str))
str.sort()
print(str[k-1])

Fixed submission:
s=input()
k=int(input())
str=[]
p=1
for i in range(k):
    for j in range(0,len(s)-i):
        str.append(s[j:j+i+1])
str=list(set(str))
str.sort()
print(str[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
str=[]
p=1
for i in range(k):
    for j in range(len(s)):
        if j+i+1<=len(s):
            str.append(s[j:j+i+1])
            str=list(set(str))
str.sort()
print(str[k-1])

Fixed submission:
s=input()
k=int(input())
str=[]
p=1
for i in range(k):
    for j in range(0,len(s)-i):
        str.append(s[j:j+i+1])
str=list(set(str))
str.sort()
print(str[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
str=[]
p=1
for i in range(len(s)):
    for j in range(len(s)):
        if j+i+1<=len(s):
            str.append(s[j:j+i+1])
    str=list(set(str))
str.sort()
print(str[k-1])

Fixed submission:
s=input()
k=int(input())
str=[]
p=1
for i in range(k):
    for j in range(0,len(s)-i):
        str.append(s[j:j+i+1])
str=list(set(str))
str.sort()
print(str[k-1])
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
mass=[]
frame=[["."]*(w+2) for i in range(h+2)]
for i in range(h):
    mass.append(list(input()))
for i in range(h):
    for j in range(w):
        frame[i+1][j+1]=mass[i][j]
for i in range(1,h):
        for j in range(1,w):
            if frame[i][j]=="#" and frame[i][j]!=frame[i][j+1] and frame[i][j]!=frame[i+1][j] and frame[i][j]!=frame[i][j-1] and frame[i][j]!=frame[i-1][j]:
                    print("No")
                    exit()
print("Yes")	


Fixed submission:
a,b=map(int,input().split())
if a>12 or b>31 :
    print("none")
else:
    if a>b:
        print(a-1)
    else:
        print(a)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
k=int(input())
if 0<k<11 and 0<a<=50 and 0<b<=50 and 0<c<=50: 
    l=[a,b,c]
    l.reverse()
    l[0]=l[0]*(2**k)
else:
    print("No")
print(sum(l))

Fixed submission:
a,b=map(int,input().split())
if a>12 or b>31 :
    print("none")
else:
    if a>b:
        print(a-1)
    else:
        print(a)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))

bo = True
if a[0]+a[1] < a[2]*2:
    bo = False
if a[3] > a[4]:
    if bo == True and a[2]*2 >= a[0]:
            price = a[2]*a[4]*2 + (a[3]-a[4])*a[0]
    elif bo == True:
        price = a[2]*a[3]*2
    else:
        price = a[0]*a[3]+a[1]*a[4]
else:
    if bo == True and a[2]*2 >= a[1]:
            price = a[2]*a[3]*2 + (a[4]-a[3])*a[1]
    elif bo == True:
        price = a[2]*a[4]*2
    else:
        price = a[0]*a[3]+a[1]*a[4]
print(price)

Fixed submission:
#-*- coding: utf-8 -*-

price = 700
S = input()
for i in S:
    if i == 'o':
        price = price + 100
print(price)

Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))

bo = True
if a[0]+a[1] < a[2]*2:
    bo = False
if a[3] > a[4]:
    if bo == True:
        if a[2]*2 >= a[0]:
            price = a[2]*a[4]*2 + (a[3]-a[4])*a[0]
        else:
            price = a[2]*a[3]*2
    else:
        price = a[0]*a[3]+a[1]*a[4]
else:
    if bo == True:
        if a[2]*2 >= a[1]:
            price = a[2]*a[3]*2 + (a[4]-a[3])*a[1]
        else:
            price = a[2]*a[4]*2
    else:
        price = a[0]*a[3]+a[1]*a[4]
print(price)

Fixed submission:
#-*- coding: utf-8 -*-

price = 700
S = input()
for i in S:
    if i == 'o':
        price = price + 100
print(price)

Buggy python submission (verdict: Runtime Error):
import sys

N, X = map(int, input().split())
a=[]
i = N
for line in sys.stdin:
    a.append(int(line))
a.sort()

X = X - sum(a)
while X - a[0] > 0:
    X = X - a[0]
    i = i + 1
print(i)

Fixed submission:
#-*- coding: utf-8 -*-

price = 700
S = input()
for i in S:
    if i == 'o':
        price = price + 100
print(price)

Buggy python submission (verdict: Runtime Error):
#-*- coding: utf-8 -*-

price = 700
S = raw_input()
for i in S:
    if i= 'o':
        price = price + 100
print price

Fixed submission:
#-*- coding: utf-8 -*-

price = 700
S = input()
for i in S:
    if i == 'o':
        price = price + 100
print(price)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())

_all = []

for i in range(1, len(s)+1):
	for j in range(len(s)-i+1):
		sub = s[j:j+i]
		if sub not in _all:
			_all.append(sub)

print(sorted(_all)[k-1])

Fixed submission:
s = input()
k = int(input())

_all = []

for i in range(1, min(k+1, len(s)+1)):
	for j in range(len(s)-i+1):
		sub = s[j:j+i]
		if sub not in _all:
			_all.append(sub)

print(sorted(_all)[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())

_all = []

for i in range(1, len(s)+1):
	for j in range(len(s)-i+1):
		_all.append(s[j:j+i])


_set = set(_all)
print(sorted(_set)[k-1])

Fixed submission:
s = input()
k = int(input())

_all = []

for i in range(1, min(k+1, len(s)+1)):
	for j in range(len(s)-i+1):
		sub = s[j:j+i]
		if sub not in _all:
			_all.append(sub)

print(sorted(_all)[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import math

s = input()
X = int(input())
dic = []

for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        if s[i:j] not in dic:
            dic.append(s[i:j])
dic.sort()
print(dic[X-1])

Fixed submission:
# -*- coding: utf-8 -*-
import math

s = input()
K = int(input())
dic = []

for i in range(len(s)):
    for j in range(i+1, i+6):
        if s[i:j] not in dic:
            dic.append(s[i:j])
dic.sort()
print(dic[K-1])
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

# 入力
N, X = map(int, input().split())
m = [int(input()) for i in range(N)]

cnt = 0

# 最初に全種類生産
for i in m:
    X -= i
    cnt += 1

# 最も安く作れるものを量産
m.sort()
cnt += int(X / m[0])

# 出力
print(cnt)

Fixed submission:
# -*- coding: utf-8 -*-

# 入力
S = input()

y = 700
S = list(S)
for i in S:
    if i == 'o':
        y += 100

# 出力
print(y)
Buggy python submission (verdict: Runtime Error):

def count():
    a, b, x = map(int, input().split())
    count = 0
    for i in range(a, b+1):
        if i % x == 0:
            count += 1

    print(count)


if __name__ == "__main__":
    count()

Fixed submission:

def contest(x):

    x = x.split()
    print(x[0][0] + x[1][0] + x[2][0])

if __name__ == "__main__":
    
    x = input()
    contest(x)

Buggy python submission (verdict: Runtime Error):

def count():
    a, b, x = map(int, input().split())
    count = 0
    for i in range(a, b+1):
        if i % x == 0:
            count += 1

    print(count)


if __name__ == "__main__":
    count()



Fixed submission:

def contest(x):

    x = x.split()
    print(x[0][0] + x[1][0] + x[2][0])

if __name__ == "__main__":
    
    x = input()
    contest(x)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np


N = int(input())
A = list(map(int, input().split()))
count = 0
num_list = []
A_list = []


if N == 1:
    if A[0] == 0:
        count += 1
    print(count)
else:
    num = A[0]
    num_list.append(A[0])
    for i in A[1:]:
        num += i
        num_list.append(num)
    A2 = np.array(num_list)
    A_list += list(A2)
    for n, i in enumerate(A):
        A2 = A2 - i
        A2 = A2[1:]
        if len(A) - 1 != n:
            A_list += list(A2)
    print(A_list.count(0))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
dic = {0:1}
sum_n = 0
count = 0


for a in A:
    sum_n += a
    if sum_n in dic:
        count += dic[sum_n]
        dic[sum_n] += 1
    else:
        dic[sum_n] = 1


print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0

count = A.count(0)
A = [n for n in A if n != 0]

for i in range(N):
    num = A[i]
    for Aj in A[i+1:]:
        num += Aj
        if num == 0:
            count += 1

print(count)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
dic = {0:1}
sum_n = 0
count = 0


for a in A:
    sum_n += a
    if sum_n in dic:
        count += dic[sum_n]
        dic[sum_n] += 1
    else:
        dic[sum_n] = 1


print(count)
Buggy python submission (verdict: Time Limit Exceeded):
from statistics import median


N = int(input())
X = list(map(int, input().split()))
for i in range(N):
    x = X[:]
    del x[i]
    print(median(x))

Fixed submission:
from statistics import median


N = int(input())
X = list(map(int, input().split()))
medi_X = median(X)
sort_X = sorted(X)

for x in X:
    if x < medi_X:
        print(sort_X[int((N + 1) / 2)])
    else:
        print(sort_X[int(((N + 1) / 2) - 1)])
Buggy python submission (verdict: Runtime Error):
import itertools


n = int(input())
a = list(map(int, input().split()))

if n == 2:
    print(max(a), min(a))
else:
    a = list(set(a))
    num = 0
    for x in itertools.combinations(a, 2):
        if num < len(list(itertools.combinations(range(max(x)), min(x)))):
            num = len(list(itertools.combinations(range(max(x)), min(x))))
            x1 = max(x)
            x2 = min(x)
    print(x1, x2)

Fixed submission:
n = input()
a = sorted(int(x) for x in input().split())
max_a = a[-1]
print(max_a, min(a, key=lambda x: abs(max_a - x * 2)))
Buggy python submission (verdict: Time Limit Exceeded):
re = list()
a,b,k = map(int, raw_input().split())
li = [i for i in xrange(a,b+1)]
re += li[:k]
li.sort(reverse=True)
re += li[:k]
for i in sorted(list(set(re))):
    print i


Fixed submission:
a,b,k = map(int, raw_input().split())
li = [i for i in xrange(a,b+1)] if (b-a+1)/2 < float(k) else [i for i in xrange(a,a+k)]+[i for i in xrange(b-k+1,b+1)]
for i in sorted(list(set(li))):
    print i
Buggy python submission (verdict: Runtime Error):
s = ["M", "A", "R", "C", "H"]
n = int(raw_input())
li = list()
for m in range(0,n):
    li.append(raw_input())
re = list()

for st1 in li:
    temp = list()
    if st1[0] in s:
        temp.append(st1)

    for st2 in li:
        if st2[0] in s and len(filter(lambda e:e[0]==st2[0], temp)) == 0:
            temp.append(st2)
        for st3 in li:
            if st3[0] in s and len(filter(lambda e:e[0]==st3[0], temp)) == 0:
                temp.append(st3)
                if sorted(temp) not in re and len(temp) == 3:
                    re.append(sorted(temp))
                    temp.pop()
        temp = [temp[0]]
print re
print len(re)

Fixed submission:
import itertools

n = int(raw_input())
li = list()
for m in range(0,n):
    li.append(raw_input())

m = len(filter(lambda x: x[0]=="M" ,li))
a = len(filter(lambda x: x[0]=="A" ,li))
r = len(filter(lambda x: x[0]=="R" ,li))
c = len(filter(lambda x: x[0]=="C" ,li))
h = len(filter(lambda x: x[0]=="H" ,li))

con = [m, a, r, c, h]
print sum(map(lambda x: x[0]*x[1]*x[2] , list(itertools.combinations(con, 3))))
Buggy python submission (verdict: Time Limit Exceeded):
substrs = set()
string = input()
k = int(input())

def solve(string):
	if len(string) == 0:
		return
	if string in substrs:
		return
	substrs.add(string)
	for i in range(1,len(string)+1):
		solve(string[:i])
	solve(string[1:])

solve(string)
substrs = sorted(list(substrs))
for i,s in enumerate(substrs):
	if i == k-1:
		print(s)
		break


Fixed submission:
substrs = set()
string = input()
k = int(input())

for i in range(len(string)):
	for j in range(i, i+5):
		substrs.add(string[i:j+1])

substrs = sorted(list(substrs))
for i,s in enumerate(substrs):
	if i == k-1:
		print(s)
		break

Buggy python submission (verdict: Runtime Error):
import numpy as np

s = input()
K = int(input())
L = len(s)

candidate = []

for l in range(1, K + 1):
    for j in range(0, L - l):
        candidate.append(s[j:j+l])

print(np.sort(candidate)[K-1])

Fixed submission:
import numpy as np

s = input()
K = int(input())
L = len(s)

candidate = []

for l in range(1, K + 1):
    for j in range(0, L - l + 1):
        candidate.append(s[j:j+l])

candidate = list(set(candidate))
print(np.sort(candidate)[K-1])
Buggy python submission (verdict: Runtime Error):
height = int(input())
width = int(input())

for hindex in range(height):
    x = input()
    print(x)
    print(x)


Fixed submission:
(height, weight) = tuple(input().split(' '))

for hindex in range(int(height)):
    x = input()
    print(x)
    print(x)
Buggy python submission (verdict: Runtime Error):
input = raw_input().split(' ')
K = int(input[0])
T = int(input[1])
input = raw_input().split(' ')
max_num = 0
sum_num = 0
for i in range(0, T):
  temp = int(input[i])
  if max_num < temp:
    max_num = temp
  sum_num += temp

if max_num <= sum_num - max_num + 1:
  print "0"
else:
  print max_num - (sum_num - max_num) - 1


Fixed submission:
input = raw_input().split(' ')
K = int(input[0])
T = int(input[1])
input = raw_input().split(' ')
max_num = 0
sum_num = 0
for i in range(0, T):
  temp = int(input[i])
  if max_num < temp:
    max_num = temp
  sum_num += temp

if max_num <= sum_num - max_num + 1:
  print "0"
else:
  print max_num - (sum_num - max_num) - 1
Buggy python submission (verdict: Runtime Error):
N = int(input())


def is_prime(n):
    for i in range(1, n):
        if i != 1 and n % i == 0:
            return False
    return True


def prime_numbers():
    num = 2
    while True:
        is_num_prime = is_prime(num)
        if is_num_prime:
            yield num
        num += 1


prime_gene = prime_numbers()
ans = []

while len(ans) < 5:
    prime = next(prime_gene)
    if prime_gene % 5 == 1:
        ans.append(prime)
print(ans)


Fixed submission:
N = int(input())


def is_prime(n):
    for i in range(1, n):
        if i != 1 and n % i == 0:
            return False
    return True


def prime_numbers():
    num = 5
    while True:
        is_num_prime = is_prime(num)
        if is_num_prime and num % 5 == 1:
            yield num
        num += 1


prime_gene = prime_numbers()
ans = [next(prime_gene) for _ in range(N)]
print(*ans)
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
S = []
flag = True
for i in range(h):
    r = list(input())
    S.append(r)
for i in range(0,h-1):
    for j in range(0,w-1):
        if S[i][j]=='#' and S[i-1][j]=='.' and S[i][j-1]=='.' and S[i+1][j]=='.' and S[i][j+1]=='.':
            flag = False
if flag:
    print('Yes')
else:
    print('No')

Fixed submission:
a, b = map(int, input().split())
th = a-1
if b>=a:
    th+=1
print(th)

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
k = int(input())
m = max(a,b,c)
output = m*2**k+a+b+c-m
print(output)

Fixed submission:
a, b = map(int, input().split())
th = a-1
if b>=a:
    th+=1
print(th)

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
k = int(input())
maxnum = max(a,b,c)
output = maxnum*2**k+a+b+c-maxnum
print(output)

Fixed submission:
a, b = map(int, input().split())
th = a-1
if b>=a:
    th+=1
print(th)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
th = a-1
if a<b:
    print(th)
else:
    print(th+1)

Fixed submission:
a, b = map(int, input().split())
th = a-1
if b>=a:
    th+=1
print(th)
Buggy python submission (verdict: Runtime Error):
HW = input().split()

H = int(HW[0])
W = int(HW[1])

tmp1 = ("." * W) + ".."
s = [list(tmp1)]
for i in range(H):
    tmp2 = "." + input() + "."
    s.append(list(tmp2))
s.append(list(tmp1))

checker = 1
for i in range(1, H+1):
    for j in range(1, W+1):
        if s[i, j] == "#":
            if s[i, j-1] == "." and s[i-1, j] == "." and s[i, j+1] == "." and s[i+1, j] == ".":
                checker == 0

if checker == 0:
    print("No")
else:
    print("Yes")


Fixed submission:
HW = input().split()

H = int(HW[0])
W = int(HW[1])

tmp1 = ("." * W) + ".."
s = [list(tmp1)]
for i in range(H):
    tmp2 = "." + input() + "."
    s.append(list(tmp2))
s.append(list(tmp1))

checker = 1
for i in range(1, H+1):
    for j in range(1, W+1):
        if s[i][j] == "#":
            if s[i][j-1] == "." and s[i-1][j] == "." and s[i][j+1] == "." and s[i+1][j] == ".":
                checker = 0
                break
    if checker == 0:
        break

if checker == 0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

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

max_num = 10**18 // X

for i in range(max_num + 1):
    if i == 0:
        continue
    else:
        if (i * X) % Y != 0:
            print(i * X)
            break
        else:
            if i == (max_num + 1):
                print(-1)
            else:
                continue


Fixed submission:
# -*- coding: utf-8 -*-

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

max_num = 10**18 // X


if X % Y == 0:
    print(-1)
else:
    for i in range(max_num + 1):
        if i == 0:
            continue
        else:
            if (i * X) % Y != 0:
                print(i * X)
                break
            else:
                continue

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

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

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


Fixed submission:
# -*- coding: utf-8 -*-

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

max_num = 10**18 // X


if X % Y == 0:
    print(-1)
else:
    for i in range(max_num + 1):
        if i == 0:
            continue
        else:
            if (i * X) % Y != 0:
                print(i * X)
                break
            else:
                continue

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

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

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


Fixed submission:
# -*- coding: utf-8 -*-

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

max_num = 10**18 // X


if X % Y == 0:
    print(-1)
else:
    for i in range(max_num + 1):
        if i == 0:
            continue
        else:
            if (i * X) % Y != 0:
                print(i * X)
                break
            else:
                continue