Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input().split()

for x in S:
  if x is 'Y'
  	print('Four')
    exit()
  else:
    print('Three')

Fixed submission:
N = int(input())
S = list(input().split())

print('Four' if 'Y' in S else 'Three')
Buggy python submission (verdict: Runtime Error):
N = input()
A = input()
 
if(N % 500 <= A):
  print("Yes/n")
else:
  print("No/n")

Fixed submission:
N = int(input())
A = int(input())
 
if(N % 500 <= A):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N = input()
A = input()

if(N % 500 <= A):
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
A = int(input())
 
if(N % 500 <= A):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N = input()
A = input()

if(N / 500 <= A):
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
A = int(input())
 
if(N % 500 <= A):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N = input()
A = input()

if(N / 500 < A):
	print("Yes)
else:
    print("No")

Fixed submission:
N = int(input())
A = int(input())
 
if(N % 500 <= A):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N = input()
A = input()

if(N / 500 < A)
	print("Yes)
else
    print("No")

Fixed submission:
N = int(input())
A = int(input())
 
if(N % 500 <= A):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
if(input() / 500 < input())
	print("Yes")

Fixed submission:
N = int(input())
A = int(input())
 
if(N % 500 <= A):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
answer = 0
for i in range(A+1):
	for j in range(B+1):
		for k in range(C+1):
			if X == 500*A + 100*B + 50*C:
				answer++
print(answer)


Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
answer = 0
for i in range(A+1):
	for j in range(B+1):
		for k in range(C+1):
			if X == 500*i + 100*j + 50*k:
				answer+=1
print(answer)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
answer = 0
for i in range(A+1):
	for j in range(B+1):
		for k in range(C+1):
			if X == 500*A + 100*B + 50*C
				answer++
print(answer)


Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
answer = 0
for i in range(A+1):
	for j in range(B+1):
		for k in range(C+1):
			if X == 500*i + 100*j + 50*k:
				answer+=1
print(answer)
Buggy python submission (verdict: Runtime Error):
a, b = input().split()

if(a*b % 2 == 0):
	print("Even")
else:
  	print("Odd")

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

if((a * b) % 2 == 0):
	print("Even")
else:
  	print("Odd")

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = a*b

if(c%2==0)
	print("Even")
else
	print("Odd")

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

if((a * b) % 2 == 0):
	print("Even")
else:
  	print("Odd")
Buggy python submission (verdict: Runtime Error):
import math
import sys

n = int(input())

X = 0
Y = 0
T = 0

for i in range(n):
	t,x,y = map(int, sys.stdin.readline().split())

	d = abs(X-x)+abs(Y-y)
	if ((sum)<(T-t)) and ((d - (T-t)) % 2 == 0):
		X = x
		Y = y
		T = t
	else:
		print('No')

print('Yes')


Fixed submission:
import math
import sys

n = int(input())

for i in range(n):
	t,x,y = map(int, input().split())
	d = abs(x)+abs(y)

	if d > t or (d - t) % 2 != 0:
		print('No')
		exit()

print('Yes')
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = []
for i in range(N):
    d.add(int(input()))
print(len(set(d)))


Fixed submission:
N = int(input())
d = []
for i in range(N):
    d.append(int(input()))
print(len(set(d)))

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = []
for i in range(N):
    d.add(int(input()))
print(set(len(d)))


Fixed submission:
N = int(input())
d = []
for i in range(N):
    d.append(int(input()))
print(len(set(d)))

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = {}
for i in range(N):
    d.add(int(input()))
print(len(d))


Fixed submission:
N = int(input())
d = []
for i in range(N):
    d.append(int(input()))
print(len(set(d)))

Buggy python submission (verdict: Runtime Error):
N = int(input())
d = []
for i in range(N):
    d.add(int(input()))
print(len(d))


Fixed submission:
N = int(input())
d = []
for i in range(N):
    d.append(int(input()))
print(len(set(d)))
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N, Y;
    cin >> N >> Y;

    for(int x = 0; x <= N; x++){
        for(int y = 0; y <= N - x; y++){
            int z = N - x - y;
            if((10000*x + 5000*y + 1000*z) == sum)
                cout << x << ' ' << y << ' ' << z << endl;
            else
                cout << -1 << ' ' << -1 << ' ' << -1 << endl;
        }
    }
}


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

for x in range(N+1):
	for y in range(N+1 - x):
		z = N - x - y
		if 10000*x + 5000*y + 1000*z == sum:
			print(x, y, N - x - y)
			exit()
print(-1, -1, -1)

Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N, Y;
    cin >> n >> sum;

    int res;
    for(int x = 0; x <= n; x++){
        for(int y = 0; y <= n - x; y++){
            int z = n - x - y;
            res = 10000 * x + 5000 * y + 1000 * z;
            if(res == sum)
                cout << x << ' ' << y << ' ' << z << endl;
            else
                cout << -1 << ' ' << -1 << ' ' << -1 << endl;
        }
    }
}


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

for x in range(N+1):
	for y in range(N+1 - x):
		z = N - x - y
		if 10000*x + 5000*y + 1000*z == sum:
			print(x, y, N - x - y)
			exit()
print(-1, -1, -1)
Buggy python submission (verdict: Runtime Error):
X = input()
sum = 0

for i in range(len(x)):
  sum += int(x[i])
  
if int(x) % sum == 0
  print("Yes")
else
  print("No")

Fixed submission:
x = input()
sum = 0

for i in range(len(x)):
  sum += int(x[i])
  
if int(x) % sum == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = input()

print(n[0] + str(len(s) + n[len(s)-2]))

Fixed submission:
s = input()
N = len(s)
print(s[0] + str(N - 2) + s[N - 1])

Buggy python submission (verdict: Runtime Error):
s = input()
N = s.len(s)
print(s[0] + str(N - 2) + s[N - 1]

Fixed submission:
s = input()
N = len(s)
print(s[0] + str(N - 2) + s[N - 1])
Buggy python submission (verdict: Runtime Error):
a = [64, 32, 16, 8, 4, 2, 1]
N = int(input())
 
for i in a:
  if i < N:
    print(i)
    return

Fixed submission:
a = [64, 32, 16, 8, 4, 2, 1]
N = int(input())
 
for i in a:
  if i <= N:
    print(i)
    break
Buggy python submission (verdict: Runtime Error):
K, S = map(int, input().split())
answer = 0

for x in range(K+1):
  for y in range(K+1):
	if S - x - y <= K:
    	answer += 1
 
print(answer)

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

for x in range(K+1):
  for y in range(K+1):
    if S - x - y <= K and S -x-y >=0:
      answer += 1
 
print(answer)
Buggy python submission (verdict: Runtime Error):
abc = [int (x) in input().split()]
abc.sort()
print('YES' if abc == [5, 5, 7] else 'NO')


Fixed submission:
abc = [int (x) for x in input().split()]
abc.sort()
print('YES' if abc == [5, 5, 7] else 'NO')
Buggy python submission (verdict: Runtime Error):
N = input()
lst = input().split(" ")
list(map(int, lst))
max  = max(lst)
sum = sum(lst)
if sum - max < max:
    print("YES")
else:
    print("NO")


Fixed submission:
N = input()
lst = input().split(" ")
lst2 = []
for i in lst:
    int_i = int(i)
    #print(int_i)
    lst2.append(int_i)
#print(lst2)
max  = max(lst2)
#print(max)
sum = sum(lst2)
#print(sum)
if sum - max > max:
    print("Yes")
else:
    print("No")
#input()

Buggy python submission (verdict: Runtime Error):
N = input()
lst = input().split(" ")
max  = max(lst)
sum = sum(lst)
if sum - max < max:
  print("YES")
else:
  print("NO")

Fixed submission:
N = input()
lst = input().split(" ")
lst2 = []
for i in lst:
    int_i = int(i)
    #print(int_i)
    lst2.append(int_i)
#print(lst2)
max  = max(lst2)
#print(max)
sum = sum(lst2)
#print(sum)
if sum - max > max:
    print("Yes")
else:
    print("No")
#input()

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

L.sort(reverse=True)
max_num = L.pop(0)

if max_num < total(L):
  print("Yes")
else:
  print("No")


Fixed submission:
N = int(input())
L = list(map(int, input().split()))

L.sort(reverse=True)
max_num = L.pop(0)

if max_num < sum(L):
  print("Yes")
else:
  print("No")

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

L.sort(reverse=True)
max_num = L.pop(0)

if max_num < total(L):
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
L = list(map(int, input().split()))

L.sort(reverse=True)
max_num = L.pop(0)

if max_num < sum(L):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[]
S_list=[]
for i in range(N):
    S.append(input())
S.sort()
print(''.join(S))

Fixed submission:
A,B,C=map(int,input().split())
a=str(A)
b=str(B)
c=str(C) 
s=a+b+c
if s.count("5")==2 and s.count("7")==1:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split())
S=[]
S_list=[]
for i in range(N):
    S.append(input())
S.sort()
print("".join(S))

Fixed submission:
A,B,C=map(int,input().split())
a=str(A)
b=str(B)
c=str(C) 
s=a+b+c
if s.count("5")==2 and s.count("7")==1:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    N, M = map(int, input().split())
    city_list = []
    for i in range(M):
        city_list.append(list(map(int, input().split())))
    pref = {}
    pref_sort = {}
    for i in range(M):
        key = city_list[i][0]
        val = city_list[i][1]
        if str(key) in pref:
            pref[str(key)].append(val)
        else:
            pref[str(key)] = [val]
    ans = {}
    for i in range(N):
        pref[str(i+1)].sort()
    for i in range(M):
        key = city_list[i][0]
        val = city_list[i][1]
        output = str(key).zfill(6) + str(pref[str(key)].index(val)+1).zfill(6)
        print(output)

Fixed submission:
# AtCoder Beginner Contest 113-C
if __name__ == "__main__":
    N, M = map(int, input().split())
    city_list = []
    for i in range(M):
        city_list.append(list(map(int, input().split())))
    pref = {}
    pref_sort = {}
    for i in range(M):
        key = city_list[i][0]
        val = city_list[i][1]
        if str(key) in pref:
            pref[str(key)].append(val)
        else:
            pref[str(key)] = [val]
    ans = {}
    for key, val in pref.items():
        val.sort()
        for i in range(len(val)):
            ans[(key, val[i])] = str(key).zfill(6) + str(i+1).zfill(6)
    for key, val in city_list:
        print(ans[str(key), val])

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == "__main__":
    N, M = map(int, input().split())
    city_list = []
    for i in range(M):
        city_list.append(list(map(int, input().split())))
    pref = {}
    pref_sort = {}
    for i in range(N):
        pref[str(i+1)] = []
        pref_sort[str(i+1)] = []
    for i in range(M):
        pref[str(city_list[i][0])].append(city_list[i][1])
    for i in range(N):
        pref[str(i+1)].sort()
    for i in range(M):
        key = city_list[i][0]
        val = city_list[i][1]
        output = str(key).zfill(6) + str(pref[str(key)].index(val)+1).zfill(6)
        print(output)

Fixed submission:
# AtCoder Beginner Contest 113-C
if __name__ == "__main__":
    N, M = map(int, input().split())
    city_list = []
    for i in range(M):
        city_list.append(list(map(int, input().split())))
    pref = {}
    pref_sort = {}
    for i in range(M):
        key = city_list[i][0]
        val = city_list[i][1]
        if str(key) in pref:
            pref[str(key)].append(val)
        else:
            pref[str(key)] = [val]
    ans = {}
    for key, val in pref.items():
        val.sort()
        for i in range(len(val)):
            ans[(key, val[i])] = str(key).zfill(6) + str(i+1).zfill(6)
    for key, val in city_list:
        print(ans[str(key), val])
Buggy python submission (verdict: Runtime Error):
import sys
if __name__ == "__main__":
    N = int(input())
    drow_lst = [59049, 46656, 7776, 6561, 1296, 729, 216, 81, 36, 9, 6, 1]
#    drow_lst = [7776, 6561, 1296, 729, 216, 81, 36, 9, 6, 1]
    min = 1000000
    buf_lst = []
    for ele in drow_lst:
        if ele <= N:
            buf_lst.append(ele)
    drow_lst = buf_lst
    for i in range(len(drow_lst)):
        cnt = 0
        buf = N
        buf_drow_lst = drow_lst[i:len(drow_lst)]
        check = []
#        print(buf_drow_lst)
        for ele in buf_drow_lst:
#            print("buf"+str(buf))
#            print("ele"+str(ele))
            if buf % 9 == 0:
                check_buf = cnt + (buf // 9)
                check.append(check_buf)
            if buf % 6 == 0:
                check_buf = cnt + (buf // 6)
                check.append(check_buf)
            if buf >= ele:
                cnt += buf // ele
#                print("cnt"+str(cnt))
                buf = buf % ele
        if min > cnt:
            min = cnt
#        print(check)
        if len(check) > 0 and min > min(check):
            min = min(check)
    print(min)

Fixed submission:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()

dp = [99999999] * (n + 1)
dp[0] = 0
for i in range(1, n + 1):
    dp[i] = dp[i - 1] + 1
    k = 6
    while i - k >= 0:
        dp[i] = min(dp[i], dp[i - k] + 1)
        k *= 6
    k = 9
    while i - k >= 0:
        dp[i] = min(dp[i], dp[i - k] + 1)
        k *= 9
print(dp[n])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
if __name__ == "__main__":
    N = int(input())
    S = input()
    min = 100000
    for i in range(0, N):
        ws = S[0:i]
        es = S[i+1:N]
        cnt = 0
        cnt += ws.count('W')
        #for ele in ws:
        #    if ele == 'W':
        #        cnt += 1
        cnt += es.count('E')
        #for ele in es:
        #    if ele == 'E':
        #        cnt += 1
#        print(ws)
#        print(es)
#        print(cnt)
        if cnt < min:
            min = cnt
    print(min)

Fixed submission:
# 解法：累積和
N = int(input())
S = input()
pos = 0
minpos = 0
mini = 0
# (1)WWWWEE
# (2)EEEWWW
# (3)WEWEEE
for i in range(N):
    if S[i] == "W":
        pos += 1
    else:
        pos -= 1
    if pos < minpos:
        minpos = pos
        mini = i

s1 = S[0:mini].count("W")
s2 = S[mini + 1:N].count("E")
print(s1 + s2)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
if __name__ == "__main__":
    N = int(input())
    S = input()
    min = 100000
    for i in range(0, N):
        ws = S[0:i]
        es = S[i+1:N]
        cnt = 0
        for ele in ws:
            if ele == 'W':
                cnt += 1
        for ele in es:
            if ele == 'E':
                cnt += 1
        if cnt < min:
            min = cnt
    print(min)

Fixed submission:
# 解法：累積和
N = int(input())
S = input()
pos = 0
minpos = 0
mini = 0
# (1)WWWWEE
# (2)EEEWWW
# (3)WEWEEE
for i in range(N):
    if S[i] == "W":
        pos += 1
    else:
        pos -= 1
    if pos < minpos:
        minpos = pos
        mini = i

s1 = S[0:mini].count("W")
s2 = S[mini + 1:N].count("E")
print(s1 + s2)
Buggy python submission (verdict: Runtime Error):
import sys
if __name__ == "__main__":
    N = int(input())
    P = []
    Q = [0]*(N+1)
    for i in range(1, N+1):
        p = int(input())
        Q[p] = i

    # 1 4 5 2 3 -> 4 5を移動
    # 1 4 5 3 2 -> 3 4 5 を移動
    # 5 2 1 3 4 -> 1 5 を移動
    cur = 1
    max_cur = 1
    for i in range(1, N):
        if Q[i] < Q[i+1]:
            cur += 1
            max = max(cur, max_cur)
        else:
            cur = 1
    print(N - max_cur)

Fixed submission:
import sys
if __name__ == "__main__":
    N = int(input())
    P = []
    Q = [0]*(N+1)
    for i in range(1, N+1):
        p = int(input())
        Q[p] = i

    # 1 4 5 2 3 -> 4 5を移動
    # 1 4 5 3 2 -> 3 4 5 を移動
    # 5 2 1 3 4 -> 1 5 を移動
    cur = 1
    max_cur = 1
    for i in range(1, N):
        if Q[i] < Q[i+1]:
            cur += 1
            max_cur = max(cur, max_cur)
        else:
            cur = 1
    print(N - max_cur)

Buggy python submission (verdict: Runtime Error):
import sys
if __name__ == "__main__":
    N = int(input())
    P = []
    Q = [0]*(N+1)
    for i in range(N):
        p = int(input())
        Q[p] = i

    # 1 4 5 2 3 -> 4 5を移動
    # 1 4 5 3 2 -> 3 4 5 を移動
    # 5 2 1 3 4 -> 1 5 を移動
    cur = 1
    max_cur = 1
    for i in range(1, N):
        if Q[i] < Q[i+1]:
            cur += 1
            max = max(cur, max_cur)
        else:
            cur = 1
    print(N - max_cur)

Fixed submission:
import sys
if __name__ == "__main__":
    N = int(input())
    P = []
    Q = [0]*(N+1)
    for i in range(1, N+1):
        p = int(input())
        Q[p] = i

    # 1 4 5 2 3 -> 4 5を移動
    # 1 4 5 3 2 -> 3 4 5 を移動
    # 5 2 1 3 4 -> 1 5 を移動
    cur = 1
    max_cur = 1
    for i in range(1, N):
        if Q[i] < Q[i+1]:
            cur += 1
            max_cur = max(cur, max_cur)
        else:
            cur = 1
    print(N - max_cur)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
if __name__ == "__main__":
    N = int(input())
    X = list(map(int, (input().split(' '))))
    for i in range(N):
        buf = list(X)
        buf.pop(i)
        buf = sorted(buf)
        print(buf[int(N/2)-1])

Fixed submission:
import sys
if __name__ == "__main__":
    N = int(input())
    X = list(map(int, (input().split(' '))))
    buf = sorted(X)
    for i in range(N):
#        buf = list(X)
#        buf.pop(i)
#        buf = sorted(buf)
#        print(X[i])
#        print(buf[int(N/2)])
        if X[i] < buf[int(N/2)]:
            print(buf[int(N/2)])
        else:
            print(buf[int(N/2)-1])
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == "__main__":
    N, M = list(map(int, (input().split(' '))))
    ura = 0
    if N == 1 and M != 1:
        arr = [0 for i in range(N)]
        ura = M - 2
    elif N != 1 and M == 1:
        arr = [0 for i in range(M)]
        ura = N - 2
    elif N == 1 and M == 1:
        ura = 1
    else:
        arr = [[0 for i in range(M)] for j in range(N)]
        for i in range(N):
            for j in range(M):
                for buf_i in range(-1, 2):
                    for buf_j in range(-1, 2):
                        if i-buf_i < 0 or i+buf_i >= N or j-buf_j < 0 or j+buf_j >= M:
                            continue
                        if arr[i+buf_i][j+buf_j] == 0:
                            arr[i+buf_i][j+buf_j] = 1
                        else:
                            arr[i+buf_i][j+buf_j] = 0
        for i in range(N):
            for j in range(M):
                if arr[i][j] == 1:
                    ura += 1
    print(ura)

Fixed submission:
if __name__ == "__main__":
    N, M = list(map(int, (input().split(' '))))
    ura = 0
    if N == 1 and M != 1:
        arr = [0 for i in range(N)]
        ura = M - 2
    elif N != 1 and M == 1:
        arr = [0 for i in range(M)]
        ura = N - 2
    elif N == 1 and M == 1:
        ura = 1
    else:
#        arr = [[0 for i in range(M)] for j in range(N)]
#        for i in range(N):
#            for j in range(M):
#                for buf_i in range(-1, 2):
#                    for buf_j in range(-1, 2):
#                        if i-buf_i < 0 or i+buf_i >= N or j-buf_j < 0 or j+buf_j >= M:
#                            continue
#                        if arr[i+buf_i][j+buf_j] == 0:
#                            arr[i+buf_i][j+buf_j] = 1
#                        else:
#                            arr[i+buf_i][j+buf_j] = 0
#        for i in range(N):
#            for j in range(M):
#                if arr[i][j] == 1:
#                    ura += 1
        ura = N * M - (N * 2 + M * 2 - 4)
    print(ura)
Buggy python submission (verdict: Runtime Error):
import sys

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, (input().split(' '))))
    B = list(map(int, (input().split(' '))))

    a_sum = 0
    for x in A:
        a_sum += x
    b_sum = 0
    for x in B:
        b_sum += x
    if a_sum > b_sum:
        print('No')
        sys.exit()
    if (a_sum + N) < b_sum:
        print('No')
        sys.exit()
    a_plus = 0
    b_plus = 0
    a_plus_cnt = 0
    b_plus_cnt = 0
    A_list = []
    B_list = []
    for i in range(N):
        if A[i] < B[i]:
            a_plus += (B[i] - A[i])
            if A[i] < B[i] - 1:
                a_plus_cnt += ((B[i] - A[i]) // 2)
        elif A[i] > B[i]:
            b_plus += (A[i] - B[i])
            b_plus_cnt += (A[i] - B[i])
    if a_plus < b_plus * 2:
        print('No')
        sys.exit()
    if a_plus_cnt < b_plus_cnt:
        print('No')
        sys.exit()
#    if a_plus // 2 > N:
#        print('No')
#        sys.exit()
#    if a_plus_cnt != b_plus_cnt:
#        print('No')
#        sys.exit()
    print('Yes')

Fixed submission:
import sys

if __name__ == "__main__":
    X, Y = map(int, (input().split(' ')))
    max = X
    min = Y
    if X < Y:
        print(X)
        sys.exit()
#        max = Y
#        min = X
    if max % min == 0:
        print(-1)
        sys.exit()
    sho = (pow(10, 18) // X)  + 1
    for i in range(1, sho):
        num = X * i
        if (num % Y != 0):
            print(num)
            sys.exit()
    print(-1)

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

if __name__ == "__main__":
    N = int(input())
    A = list(map(int, (input().split(' '))))
    B = list(map(int, (input().split(' '))))

    a_sum = 0
    for x in A:
        a_sum += x
    b_sum = 0
    for x in B:
        b_sum += x
    if a_sum > b_sum:
        print('No')
        sys.exit()
    if (a_sum + N) < b_sum:
        print('No')
        sys.exit()
    a_plus = 0
    b_plus = 0
    for i in range(N):
        if A[i] < B[i]:
            a_plus += (B[i] - A[i])
        else:
            b_plus += (A[i] - B[i])
    if a_plus < b_plus * 2:
        print('No')
        sys.exit()
    print('Yes')

Fixed submission:
import sys

if __name__ == "__main__":
    X, Y = map(int, (input().split(' ')))
    max = X
    min = Y
    if X < Y:
        print(X)
        sys.exit()
#        max = Y
#        min = X
    if max % min == 0:
        print(-1)
        sys.exit()
    sho = (pow(10, 18) // X)  + 1
    for i in range(1, sho):
        num = X * i
        if (num % Y != 0):
            print(num)
            sys.exit()
    print(-1)