Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
W,H,x,y = map(int,input().split())
if(W//2==x and H//2==y):
	print(W*H/2,end=" ")
	print(1)
	exit()
if(W//2==x or H//2==y):
	print(W*H/2,end=" ")
	print(0)
	exit()
minX = 0
minY = 0
min = 0
if not(W//2==x or H//2==y):
	minX = min(x,W-x)
	minY = min(y,H-y)
	if(minX>minY):
		print(minX*H//2,end=" ")
	else:
		print(minY*W//2,end=" ")
	if(x==y):
		print(1)
	else:
		print(0)

Fixed submission:
W,H,x,y = map(int,input().split())
if  x*2==W and y*2==H:
	s = 1
else:
	s = 0
print(W*H/2,s)
Buggy python submission (verdict: Time Limit Exceeded):
N , M = map(int,input().split())
L = []
R = []
cnt = 0
flag = True
for i in range(M):
	l,r = map(int,input().split())
	L.append(l)
	R.append(r)
for i in range(N+1):
	flag = True
	for j in range(M):
		if i < L[j] or i > R[j]:
			flag = False
			break
	if flag == True:
		cnt+=1
print(cnt)

Fixed submission:
N , M = map(int,input().split())
L = []
R = []
cnt = 0
flag = True
for i in range(M):
	l,r = map(int,input().split())
	L.append(l)
	R.append(r)
L_max = max(L)
R_min = min(R)
for i in range(N+1):
	flag = True
	if i >= L_max and i <= R_min:
		cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import math
R,G,B,N = map(int,input().split())
cnt = 0
for i in range(math.ceil(N/G)+1):
	for j in range(math.ceil(N/R)+1):
			tmp = N - i * G - j * R
			if  tmp >=0 and tmp % B == 0:
				cnt += 1
print(cnt)

Fixed submission:
import math
R,G,B,N = map(int,input().split())
cnt = 0
for i in range(math.ceil(N/G)+1):
	for j in range(math.ceil(N/R)+1):
			tmp = N - i * G - j * R
			if tmp < 0:
				break
			if tmp % B == 0:
				cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
	ans += len(set(A[i],B[i],C[i])) - 1
print(ans)

Fixed submission:
N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
	ans += len(set([A[i],B[i],C[i]])) - 1
print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
K = int(input())
if K == 1:
	print(int(S[i]))
else:
	if S[0] == "1":
		print(S[1])
	else:
		print(S[0])

Fixed submission:
S = input()
K = int(input())
ans = 1
if K == 1:
	print(S[0])
	exit()
else:
	for i in range(len(S)):
		if S[i] != "1" and i < K:
			ans = int(S[i])
			break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for i in range(N)]
A_set = set(A)
cnt = 0
for i in A_set:
	if A.count(i) % 2 == 1:
		cnt+=1
print(cnt)

Fixed submission:
import collections
N = int(input())
A = [int(input()) for i in range(N)]
cnt = 0
collection = collections.Counter(A)
for i in collection.values():
	if i % 2 == 1:
		cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
A = int(math.sqrt(N))
for i in reversed(range(A)):
	if(N%i==0):
		print(len(str(N//i)))
		exit()

Fixed submission:
N = int(input())
A = int(N**0.5)
for i in reversed(range(A+1)):
	if(N%i==0):
		print(len(str(N//i)))
		exit()
Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())
A = list(map(int,input().split()))
A_set = set(A)
ans=N
cut=0
for i in range(len(A_set)):
	comp = A.count(A_set.pop())
	cut+= comp-1
cut = math.ceil(cut/2)*2
print(ans-cut)

Fixed submission:
import math
import collections
N = int(input())
A = list(map(int,input().split()))
A_collections = collections.Counter(A)
ans=N
cut=0
for comp in A_collections.values():
	cut+= comp-1
cut = math.ceil(cut/2)*2
print(ans-cut)
Buggy python submission (verdict: Runtime Error):
N = int(input())
sum = 0
for i in range(1,N+1)
	sum += i
print(sum)

Fixed submission:
N = int(input())
sum = 0
for i in range(1,N+1):
	sum += i
print(sum)
Buggy python submission (verdict: Runtime Error):
a=["SUN","MON","TUE","WED","THU","FRI","SAT"]
s=input()
print(7-a.index(str))

Fixed submission:
a={'SUN':7,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1}
print(a[input()])
Buggy python submission (verdict: Runtime Error):
s = int(input())
w = int(input())

if w >= s:
  print("unsafe")
elif w < s:
  print("safe")

Fixed submission:
s,w  = map(int,input().split())
if w >= s:
  print("unsafe")
elif w < s:
  print("safe")
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

S = input().split()
if S[2]==S[3] and S[4]==S[5]:
  print("YES")
else:
  print("NO")

Fixed submission:
s = input()
if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
S = (input().split())

if S[2]==S[3] and S[4]==S[5]:
  print("YES")
else:
  print("NO")

Fixed submission:
s = input()
if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()

print(s.count("ABC")

Fixed submission:
n = int(input())
s= input()
print(s.count("ABC"))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())

for a<9 and b<9:
  print("Yay!")
else:
  print(":(")

Fixed submission:
a,b = map(int,input().split())

if a<9 and b<9:
  print("Yay!")
else:
  print(":(")
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
n = b - a + 1
if n <= k*2:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,k+1):
    print(i)
  fot j in range(b-k+1,b+1)
  print(j)


Fixed submission:
a,b,k = map(int,input().split())
n = b - a + 1
if n <= k*2:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,a+k):
    print(i)
  for j in range(b-k+1,b+1):
     print(j)
Buggy python submission (verdict: Runtime Error):
nums = input() 
N = 3
for i in range(2**N):
    equation = ''
    for j in range(N+1):
        equation += nums[j]
        if ((i >> j) & 1):
            equation += '+'
        else:
            equation += '-'
    if eval(equation) == 7:
        print(equation + '=7')
        exit()

Fixed submission:
n = input()
s = len(n)-1


for i in range(2**s):
  op = ""
  for j in range(s):
    if (i>>j)&1:
      op += "+"
    else:
      op += "-"
  ans =int(n[0])
  for j in range(len(op)):
    if op[j]=="+":
      ans += int(n[j+1])
    else:
      ans -= int(n[j+1])
  if ans == 7:
      ret = ""
      for k in range(len(op)):
        ret += n[k]
        ret += op[k]
      ret += n[-1]
      ret += "=7"
      print(ret)
      exit(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
k = int(input())
sum_list = []
for i in range(1,n+1):
  j = n-i
  if j >= 1:
    sum_list.append((2*i)+(j+k))
sum_list.sort()
print(sum_list[0])


Fixed submission:
n = int(input())
k = int(input())
sum = 1
for i in range(n):
  sum = min(sum*2,sum+k)    
print(sum)
Buggy python submission (verdict: Runtime Error):
input()
li = map(int,input().split())

print('NO' if len(li) > len(set(li)) else 'YES')

Fixed submission:
input()
li = list(map(int, input().split()))
print('NO' if len(li)>len(set(li)) else 'YES')

Buggy python submission (verdict: Runtime Error):
n = int(input())
li = map(int,input().split())
print('NO' if len(li)!=len(set(li)) else 'YES')

Fixed submission:
input()
li = list(map(int, input().split()))
print('NO' if len(li)>len(set(li)) else 'YES')
Buggy python submission (verdict: Time Limit Exceeded):
t,a,k = map(int,input().split())

for _ in range(k):
  if t:
    t-=1
  elif a:
    a-=1
print(t,a)

Fixed submission:
t,a,k = map(int,input().split())
 
t = t-k
if t<0:
  a += t
  t = 0
if a<0:
  a = 0
print(t,a)
Buggy python submission (verdict: Runtime Error):
s = input()
len_s = len(s)
c = 0
for _ in range(len_s/2):
  if(s[_] == s[-_]):
    c+=1
print(c)

Fixed submission:
s = input()
len_s = len(s)
c = 0
for _ in range(int(len_s/2)):
    if(s[_] != s[len_s-1-_]):
        c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())

if N == 1:
    print(float(N))

elif:
    n = int(N / 2) + 1
    print(float(n/N))
else:
    n = N / 2
    print(float(n/N)) 

Fixed submission:
N = int(input())

if N == 1:
    print(float(N))

elif N % 2 == 1:
    n = int(N / 2) + 1
    print(float(n/N))
else:
    n = N / 2
    print(float(n/N))
Buggy python submission (verdict: Runtime Error):
S = ' ' + input()
even_dance = ['R','U','D']
odd_dance = ['L','U','D']

flag = True

for i in range(1,len(S)):
	if i % 2 == 1:
      if S[i] in even_dance:
        pass
      else:
        flag = False
        break
        
	else:
      if S[i] in odd_dance:
        pass
      else:
        flag = False
        break
if flag:
  print('Yes')
else:
  print('No')


Fixed submission:
S = ' ' + input()
even_pat = ['R','U','D']
odd_pat = ['L','U','D']

flag = True

for i in range(1,len(S)):
    if i % 2 == 1:
        if not(S[i] in even_pat):
            flag = False
            break
    
    else:
        if not(S[i] in odd_pat):
            flag = False
            break

print('Yes' if flag else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
# N:人数, K:初期ポイント, Q:クイズ数
N, K, Q = map(int,input().split())
points = [K] * N

def not_ans(li):
    return li -1

for i in range(Q):
    anser = int(input())-1
    points = list(map(not_ans,points))
    points[anser] += 1
    
for y in range(N):
    if points[y] < 1:
        print('No')
    else:
        print('Yes')


Fixed submission:
# N:人数, K:初期ポイント, Q:クイズ数
N, K, Q = map(int,input().split())

s = K-Q

points = [s] * N

for _ in range(Q):
    ans = int(input())
    points[ans-1] += 1

for p in points:
    print('Yes' if p>0 else 'No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [ 1/int(i) for i in input().split()]

print(1/sum(s_1))

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

s_1 = 0

for a in A:
    s_1 += 1/a

print(1/s_1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

count = 0
i = 0
a_idx = 0
b_idx = 0
a_num = a[a_idx]
b_num = b[b_idx]
while(b_idx < n and a_idx <= len(a)):
    
    a_num = a_num - 1
    
    if i == b_num:
        b_num = b[b_idx]
        b_idx += 1
        i = 0
    if a_num == 0:
        a_num = a[a_idx]
        a_idx += 1
    count += 1
    i += 1
    


print(count)



Fixed submission:
N = int(input())
A = list(map(int, input().split())) # N + 1
B = list(map(int, input().split())) # N
 
# 重みがないのですべて小さい方から倒せると仮定する
cnt = 0
for i in range(N):
    cnt += min(B[i], A[i])
    diff = B[i] - A[i]
    if diff > 0:
        if A[i+1] < diff:
            cnt += A[i+1]
            A[i+1] = 0
        else:
            cnt += diff
            A[i+1] -= diff
        #A[i] = 0
    #else:
    #    A[i] -= B[i]
#print("A",A)
#print("B",B)
print(cnt)
Buggy python submission (verdict: Runtime Error):
N, D = map(int,input().split())
li = []
for _ in range(N):
    li.append(list(map(int,input().split())))

s = 0
c = 0
for n in range(-1,N-1):
    for d in range(D):
        s = s + abs(li[n][d] - li[n+1][d]) ** 2
    if (s**(1/2)).is_interger():
        c += 1
    s = 0

Fixed submission:
N, D = map(int,input().split())
li = []
for _ in range(N):
    li.append(list(map(int,input().split())))

s = 0
c = 0
for n1 in range(-1,N-1):
    for n2 in range(n1+1,N-1):
        for d in range(D):
            s = s + abs(li[n1][d] - li[n2][d]) ** 2
        s_float = float(s**(1/2))
        if s_float.is_integer():
            c += 1
        s = 0
print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())

li = list(map(int,input().split()))

co = 0

for i in range(1,len(li)-1):
  work = sort([li[i-1],li[i],li[i+1]])

  if work.index(li[i]) == 1:
    co += 1
print(co)

Fixed submission:
n = int(input())

li = list(map(int,input().split()))

co = 0

for i in range(1,len(li)-1):
  work = sorted([li[i-1],li[i],li[i+1]])

  if work.index(li[i]) == 1:
    co += 1
print(co)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ls = []
for _ in n:
  ls.append(input())
  
 print(len(set(ls)))


Fixed submission:
n = int(input())
ls = []
for _ in range(n):
  ls.append(input())
  
print(len(set(ls)))

Buggy python submission (verdict: Runtime Error):
n = int(input())
ls = []
for _ in n:
  ls.append(input())
  
 print(len(set(ls))

Fixed submission:
n = int(input())
ls = []
for _ in range(n):
  ls.append(input())
  
print(len(set(ls)))
Buggy python submission (verdict: Runtime Error):
 numpy as np
a, b, c = map(np.sqrt, map(lambda x:100*x, map(int, input().split())))
print('Yes' if a + b - c < 0  else 'No')


Fixed submission:
a, b, c = map(int, input().split())
print('Yes' if (c-a-b)>0 and 4*a*b < (c - a- b)**2 else 'No')

Buggy python submission (verdict: Runtime Error):
import numpy as np
a, b, c = map(np.sqrt, map(lambda x:100*x, map(int, input().split())))
print('Yes' if a + b - c < 0 and  else 'No')

Fixed submission:
a, b, c = map(int, input().split())
print('Yes' if (c-a-b)>0 and 4*a*b < (c - a- b)**2 else 'No')

Buggy python submission (verdict: Runtime Error):
a, b, c = int(input().split())
print('Yes' if a**2+b**2-2*a*b - c**2 < 0 else 'No')

Fixed submission:
a, b, c = map(int, input().split())
print('Yes' if (c-a-b)>0 and 4*a*b < (c - a- b)**2 else 'No')
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
t = [int(input()) for _ in range(n)]

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

ans = 1
for i in range(n):
    ans = lcm(t[i],ans)
print(ans)

Fixed submission:
import fractions
n = int(input())
t = [int(input()) for _ in range(n)]

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

ans = 1
for i in range(n):
    ans = lcm(t[i],ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print(Possible)
else:
  print(Impossible)


Fixed submission:
a = list(map(int, input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print('Possible')
else:
  print('Impossible')

Buggy python submission (verdict: Runtime Error):
a = list(map(int(), input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print(Possible)
else:
  print(Impossible)

Fixed submission:
a = list(map(int, input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print('Possible')
else:
  print('Impossible')
Buggy python submission (verdict: Runtime Error):
a = input()
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a-1):
  cnt += x[2*i]
print(cnt)


Fixed submission:
a = int(input())
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a):
  cnt += x[2*i]
print(cnt)

Buggy python submission (verdict: Runtime Error):
a = input()
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a):
  cnt += x[2*i]
print(cnt)

Fixed submission:
a = int(input())
x = sorted(list(map(int,input().split())))
cnt=0
for i in range(a):
  cnt += x[2*i]
print(cnt)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,inpput().split(' '))

if N<=M:
  print('Yes')
else:
  print('No')

Fixed submission:
N,M = map(int,input().split(' '))
 
if N<=M:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input().strip())
ns = [int(x) for x in input().split(' ')]
cnt=0
for i in range(len(ns)):
  if ns[i] == min(ns[0:i+1]):
    cnt+=1
print(cnt)

Fixed submission:
N = int(input().strip())
ns = [int(x) for x in input().split(' ')]
cnt=0
mini = 200001
for i in range(len(ns)):
  if ns[i] <mini:
    cnt+=1
    mini=ns[i]
print(cnt)
Buggy python submission (verdict: Runtime Error):
kaibun = input()
i=0
count = 0
while i+1<=len(kaibun)/2:
  if kaibun[i]!=kaibunn[-i-1]:
    count+=1
  i+=1

print(count)

Fixed submission:
kaibun = input()
i=0
count = 0
while i+1<=len(kaibun)/2:
  #print( kaibun[i],kaibun[-i-1])
  if kaibun[i]!=kaibun[-i-1]:
    count+=1
  i+=1

print(count)
Buggy python submission (verdict: Runtime Error):
a,b=mqp(input().split(' '))

if a<10 and b<10:
  print(a*b)
else:
  print(-1)

Fixed submission:
a,b=map(int,input().split(' '))

if a<10 and b<10:
  print(a*b)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
a,b = map(input().split(' '))
print(maximum(a-2*b,0))

Fixed submission:
a,b = map(int,input().split(' '))
print(max(a-2*b,0))

Buggy python submission (verdict: Runtime Error):
a,b = map(input().split(' '))
print(max(a-2*b,0))

Fixed submission:
a,b = map(int,input().split(' '))
print(max(a-2*b,0))
Buggy python submission (verdict: Runtime Error):
N = intput()

print('Yes' if '7' in N else 'No')

Fixed submission:
N = input()
 
print('Yes' if '7' in N else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
import math

K = int(input())

total = 0
for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            ab = math.gcd(a, b)
            total += math.gcd(ab, c)

print(total)

Fixed submission:
import math

K = int(input())

total = 0
for a in range(1, K + 1):
    for b in range(1, K + 1):
        ab = math.gcd(a, b)
        for c in range(1, K + 1):
            total += math.gcd(ab, c)

print(total)

Buggy python submission (verdict: Time Limit Exceeded):
import math
 
K = int(input())
 
def gcd(a, b, c):
    g = math.gcd(a, b)
    return math.gcd(g, c)
 
result = sum((gcd(a, b, c) for a in range(1, K + 1) for b in range(1, K + 1) for c in range(1, K + 1)))

print(result)

Fixed submission:
import math

K = int(input())

total = 0
for a in range(1, K + 1):
    for b in range(1, K + 1):
        ab = math.gcd(a, b)
        for c in range(1, K + 1):
            total += math.gcd(ab, c)

print(total)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, intput().split())
a = list(map(int, intput().split()))

total = sum(a)
for vote in a:
  if vote < 1/(4*m) * total:
    print("No")
    
print("Yes")

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))

a.sort(reverse=True)
total = sum(a)

if a[m - 1] < 1/(4*m) * total:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
X = int(input())

print(X // 500 * 1000 + X % 500 // 5 * 5)


Fixed submission:
S = input()

if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")
  

Fixed submission:
S = input()

if S[2] == S[3] and S[4] == S[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
X = input()

print(X // 500 * 1000 + X % 500 // 5 * 5)

Fixed submission:
X = int(input())

print(X // 500 * 1000 + X % 500 // 5 * 5)
Buggy python submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read

K, N, *A = map(int, read.split())

max_distance = K + (A[0] - A[-1])
 
for i in range(1, N):
  max_distance = max(max_distance, A[i] - A[i - 1])
  
print(K - max_distance)

Fixed submission:
K, N = map(int, input().split())
A = list(map(int, input().split()))
 
max_distance = K + (A[0] - A[-1])
 
for i in range(1, N):
  max_distance = max(max_distance, A[i] - A[i - 1])
  
print(K - max_distance)

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

max_distance = K + (A[0] - A[-1])

for i in range(1, N):
  max_distance = max(max_distance, A[i] - A[i - 1])
  
print(K - max_distance)

Fixed submission:
K, N = map(int, input().split())
A = list(map(int, input().split()))
 
max_distance = K + (A[0] - A[-1])
 
for i in range(1, N):
  max_distance = max(max_distance, A[i] - A[i - 1])
  
print(K - max_distance)
Buggy python submission (verdict: Time Limit Exceeded):
X,Y = map(int,input().split())

if X==Y:
    print(-1)
else:
    for i in range(10**18):
        X1 = int(X*(i+5))
        if X1 % Y != 0:
            print(str(X1))
            break
    



Fixed submission:
X, Y = map(int, input().split())

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

Buggy python submission (verdict: Time Limit Exceeded):
X,Y = map(int,input().split())

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



Fixed submission:
X, Y = map(int, input().split())

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

Buggy python submission (verdict: Time Limit Exceeded):
X,Y = map(int,input().split())

if X==Y:
    print(-1)
else:
    for i in range(10**18):
        X1 = int(X*X)
        if X1 % Y != 0:
            print(str(X1))
            break
    



Fixed submission:
X, Y = map(int, input().split())

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

Buggy python submission (verdict: Time Limit Exceeded):
X,Y = map(int,input().split())

if X==Y:
    print(-1)
else:
    for i in range(10**18):
        X1 = int(X*i)
        if X1 % Y != 0:
            print(str(X1))
            break
    



Fixed submission:
X, Y = map(int, input().split())

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

Buggy python submission (verdict: Runtime Error):
X,Y = int(input().split())

if X==Y:
    print(-1)
else:
    for i in range(10**18):
        X1 = int(X*i)
        if X1 % Y != 0:
            print(str(X1))
            break
    



Fixed submission:
X, Y = map(int, input().split())

if X % Y == 0:
    print(-1)
else:
   print(X)
Buggy python submission (verdict: Runtime Error):
t_hp_str,t_atack_str,a_hp_str,a_atack_str= input().split()
t_hp = int(t_hp_str)
t_atack = int(t_atack_str)
a_hp=int(a_hp_str)
a_atack = int(a_atack_str)

while True:
  if num%2 == 0:
    a_hp = a_hp - t_atack
    if a_hp <= 0:
      print("Yes")
      break
  else:
    t_hp = t_hp - a_atack
    if t_hp <= 0:
      print("No")
      break



Fixed submission:
t_hp_str,t_atack_str,a_hp_str,a_atack_str= input().split()
t_hp = int(t_hp_str)
t_atack = int(t_atack_str)
a_hp=int(a_hp_str)
a_atack = int(a_atack_str)

for num in range(300):
  if num%2 == 0:
    a_hp = a_hp - t_atack
    if a_hp <= 0:
      print("Yes")
      break
  else:
    t_hp = t_hp - a_atack
    if t_hp <= 0:
      print("No")
      break
Buggy python submission (verdict: Time Limit Exceeded):
import math
num = int(input())
result = 0
for i in range(1, num+1):
  for j in range (1, num+1):
    for k in range (1, num +1):
      result += math.gcd(math.gcd(i,j), k)
    
print(result)

Fixed submission:
import math
num = int(input())
result = 0
for i in range(1, num+1):
  for j in range (1, num+1):
    s= math.gcd(i,j)
    for k in range (1, num +1):
      result += math.gcd(s, k)
    
print(result)
Buggy python submission (verdict: Runtime Error):
S=int(input("羊の数を入力"))
W=inr(input("狼の数を入力"))
if W>=S:
   print("unsafe")
else:
   print("safe")


Fixed submission:
s, w = map(int, input().split())
if w >= s:
 print("unsafe")
else:
 print("safe")
Buggy python submission (verdict: Runtime Error):
import math
a=input()
b=input()
c=input()
if a>b:
 print(math.ceil(int(c)/int(a)))
elif a<b:
 print(math.ceil(int(c)/int(b)))
print(int(c)/int())

Fixed submission:
import math
a=input()
b=input()
c=input()
if int(a)>int(b):
 print(math.ceil(int(c)/int(a)))
elif int(a)<int(b):
 print(math.ceil(int(c)/int(b)))
elif int(a)==int(b):
 print(math.ceil(int(c)/int(b)))
Buggy python submission (verdict: Runtime Error):
s = input()
tmp = ord(s)
ans = tmp += 1
print(chr(ans))

Fixed submission:
s = input()
tmp = ord(s)
ans = tmp + 1
print(chr(ans))
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
S = input()

pos = 0
i_s = [pos]
continue_s = S[0]
while True:
    pos += 1
    if pos == N :
        break
    s = S[pos]
    if continue_s == s:
        continue
    else:
        continue_s = s
        i_s.append(pos)


i_length = len(i_s) - 1
X = []
rev = K * 2
for n,i in enumerate(i_s):
    if S[i] == "1":
        if i_length - n >= rev-1:
            if i_length - n == rev-1:
                X.append(N-i)
            elif i_length - n == rev:
                X.append(N-i)
            else:
                X.append(i_s[n+rev+1]-i)

print(max(X))




Fixed submission:
N, K = map(int,input().split())
S = input()

i = 0
for j in range(N):
    if S[j] == "0" and (j==0 or S[j-1] == "1"):
        K -= 1
    if (K<0):
        if(S[i]=="0" and S[i+1] == "1"):
            K += 1
        i+=1

print(N-i)