Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
elif h*w // 2 = 0:
  print(h*w//2)
else:
  print(h*w//2+1)

Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  print((h*w+1)//2)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a == 1 and b == 1:
  print(1)
else:
  print(a*b // 2+1)


Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  print((h*w+1)//2)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a == 1 and b == 1:
  print(0)
elif a*b % 2 == 0:
  print(a*b // 2)
else:
  print(a*b // 2 + 1)

Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  print((h*w+1)//2)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a*b % 2 == 1:
  print(a*b // 2+1)
else:
  print(a*b // 2)

Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  print((h*w+1)//2)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if a*b % 2 = 1:
  print(a*b // 2+1)
else:
  print(a*b // 2)

Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  print((h*w+1)//2)

Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())
if a*b % 2 = 0:
  print(a*b//2)
else:
  print(a*b//2+1)

Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  print((h*w+1)//2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = str(input())
b = str(input())

L =[(a+b)*n]

for i in range(n+1):
  if a == 0:
    print(b*n)
  else:
    print(b.count(n))

Fixed submission:
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
r = int(input())

if n > 10:
  print(r)
elif n = 10:
  print(r)
else:
  print(r+100*(10-n))

Fixed submission:
n,r = map(int,input().split())

if n >= 10:
  print(r)
else:
  print(r+100*(10-n))

Buggy python submission (verdict: Runtime Error):
n = int(input())
r = int(input())

if n >= 10:
  print(r)
else:
  print(r+100*(10-n))

Fixed submission:
n,r = map(int,input().split())

if n >= 10:
  print(r)
else:
  print(r+100*(10-n))
Buggy python submission (verdict: Runtime Error):
n = int(input())
X = list(map(int,input().split)())
ans = 10**100
for i in range(1,101):
  count = 0
  for j in X:
    count += (i-j)*2
  ans = min(ans,count)
print(ans)

Fixed submission:
n = int(input())
X = list(map(int,input().split()))
ans = 10**100
for i in range(1,101):
  count = 0
  for j in X:
    count += (i-j)**2
  ans = min(ans,count)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

n,a,b = map(int,input().split())
mod = 10**9+7
total = pow(2,n,mod) - 1

nPa = math.factorial(n) // math.factorial(n-a) 
nPa %= mod
nPb = math.factorial(n) // math.factorial(n-b) 
nPb %= mod
a!_1 = 1
for i in range(1,a+1):
  a!_1 = pow(i,mod-2,mod)
  a!_1 %= mod
b!_1 = 1
for i in range(1,b+1):
  b!_1 = pow(i,mod-2,mod)
  b!_1 %= mod
nCa = nPa * a!_1
nCb = nPb * b!_1
print((total-nCa-nCb)%mod)

Fixed submission:
mod = 10**9+7
n,a,b = map(int,input().split())
ans = pow(2,n,mod)-1

comb1 = 1 
for i in range(n-a+1,n+1):
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1):
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod

comb2=1
for i in range(n-b+1,n+1):
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
  
ans -= (comb1+comb2)
ans %= mod
print(ans)

Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
mod = 10**9+7
ALL = pow(2,n,m)-1
x = y = 1
for i in range(b):
    x = x * (i+1)%m
    y = y * (n-i)%m
    if i + 1 == a:
        a = b
        ALL -= y * pow(x,m-2,m)
print(ALL%m)


Fixed submission:
mod = 10**9+7
n,a,b = map(int,input().split())
ans = pow(2,n,mod)-1

comb1 = 1 
for i in range(n-a+1,n+1):
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1):
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod

comb2=1
for i in range(n-b+1,n+1):
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
  
ans -= (comb1+comb2)
ans %= mod
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
ans = 0
for a in A:
  if a % 2 == 0:
    if a % 3 == 0 or a % 5 == 0:
      ans = 1
      break()
      
if ans == 1:
  print(APPROVED)
else:
  print(DENIED)
  



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

POINT = 0
for i in A:
    if i % 2 == 0:
        if i % 3 != 0 and i % 10 != 0:
            POINT = 1
if POINT == 1:
  print("DENIED")
else:
  print("APPROVED")

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
ans = 1
for a in A:
  if a % 2 == 0:
    if a % 3 != 0 or a % 5 != 0:
      ans = 0
      break()
      
if ans:
  print(APPROVED)
else:
  print(DENIED)
  



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

POINT = 0
for i in A:
    if i % 2 == 0:
        if i % 3 != 0 and i % 10 != 0:
            POINT = 1
if POINT == 1:
  print("DENIED")
else:
  print("APPROVED")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [input() for _ in range(n)]
dic = {}
for i in range(n):
  if s[i] not in dic:
    dic[s[i]] = 1
    else:
      dic[s[i]] += 1
max_dic_val = max(dic.values()) 
ans = []
for keys in dic.keys():
  if dic[keys] == max_dic_val: 
    ans.append(keys)
ans = sorted(ans)
for words in ans:
  print(words)

Fixed submission:
n = int(input())
d = {}
for i in range(n):
    s=input()
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1
max_d = max(d.values())
print(*sorted([kv[0] for kv in d.items() if kv[1] == max_d]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
d = {}
for _ in range(n):
    s = input()
    if s in d:
        d[s] = +1
    else:
        d[s] = 1
max_d = max(d.values())
ans = sorted([a[0] for i in d.items() if a[1] == max_d])
print(ans)

Fixed submission:
n = int(input())
d = {}
for i in range(n):
    s=input()
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1
max_d = max(d.values())
print(*sorted([kv[0] for kv in d.items() if kv[1] == max_d]))

Buggy python submission (verdict: Runtime Error):
n = int(input())
d = {}
for _ in range(n):
    s = input()
    if s  in d:
        d[s] = +1
    else:
        d[s] = 1
max_d = max(d.values())
ans = d.sorted([kv[0] for kv in d.items() if kv[1] == max_d])
print(ans)

Fixed submission:
n = int(input())
d = {}
for i in range(n):
    s=input()
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1
max_d = max(d.values())
print(*sorted([kv[0] for kv in d.items() if kv[1] == max_d]))
Buggy python submission (verdict: Runtime Error):
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k:
  print(x-1,y)
else:
  print(x,y-1)


Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if S==U:
    A -= 1
else:
    B -= 1
print(A,B)

Buggy python submission (verdict: Runtime Error):
a,b = input().split()
x,y = map(int,input().split())
k = int(input())

if a == k:
  print(x-1,y)
else:
  print(x,y-1)


Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if S==U:
    A -= 1
else:
    B -= 1
print(A,B)

Buggy python submission (verdict: Runtime Error):
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k:
  print(x-1,y)
else:
  print(x,y-1)


Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if S==U:
    A -= 1
else:
    B -= 1
print(A,B)

Buggy python submission (verdict: Runtime Error):
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k :
  print(x-1,y)
else
  print(x,y-1)


Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if S==U:
    A -= 1
else:
    B -= 1
print(A,B)

Buggy python submission (verdict: Runtime Error):
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k :
  print(x-1,y)
elif b == k :
  print(x,y-1)
else:
  print(x,y)


Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if S==U:
    A -= 1
else:
    B -= 1
print(A,B)

Buggy python submission (verdict: Runtime Error):
a,b = str(input().split())
x,y = int(input().split())
k = str(input())

if "a" == "k" :
  print(x-1,y)
elif "b" == "k" :
  print(x,y-1)
else:
  print(x,y)

Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if S==U:
    A -= 1
else:
    B -= 1
print(A,B)

Buggy python submission (verdict: Runtime Error):
a,b = str(input().split())
x,y = int(input().split())
k = str(input())

if a == k :
  print(x-1,y)
elif b == k :
  print(x,y-1)
else:
  print(x,y)

Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if S==U:
    A -= 1
else:
    B -= 1
print(A,B)
Buggy python submission (verdict: Runtime Error):
s = input()
for i in s:
  s[i]=x
print(s)

Fixed submission:
s = list(input())
n = len(s)
print('x'*n)
Buggy python submission (verdict: Runtime Error):
n,a = map(int,input())
if n%a == 0:
  print(n//a)
else:
  print(n//a +1)

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

ans = 0

while h > 0:
    ans += 1
    h -= a

print(ans)
Buggy python submission (verdict: Runtime Error):
h,n = map(int,input().split())
sp = (map(int,input().split())) for i in range(n):
  if h > sum(sp):
    print('No')
  else:
    print('Yes')


Fixed submission:
h,n = map(int,input().split())
a = list(map(int,input().split()))
if sum(a) >= h:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
h,n = map(int,input().split())
sp = (map(int,input().split())) for i in range(n)
if h > sum(sp):
  print('No')
else:
  print('Yes')

Fixed submission:
h,n = map(int,input().split())
a = list(map(int,input().split()))
if sum(a) >= h:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
h,n = map(int,input().split())
sp = [list(map(int,input().split()))for i in range(n)]
if h > sum(sp):
  print('No')
else:
  print('Yes')

Fixed submission:
h,n = map(int,input().split())
a = list(map(int,input().split()))
if sum(a) >= h:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if n-k+1 <= 0:
  print(0)
  quit()
else:
  L = l[0:n-K+1]
  L_sum = sum(L)
  print(L_sum)

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if len(l) > k:
    print(sum(l[:n-k]))
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
L = l[0:n-K+1]
L_sum = sum(L)
print(L_sum)

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if len(l) > k:
    print(sum(l[:n-k]))
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
L = l[0,n-K+1]
L_sum = sum(L)
print(L_sum)

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if len(l) > k:
    print(sum(l[:n-k]))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    ans += 1
     min_p = i
print(ans)


Fixed submission:
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    ans += 1
    min_p = i
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    ans += 1
     min_p = i
print(ans)


Fixed submission:
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    ans += 1
    min_p = i
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    cnt += 1
     min_p = i
print(ans)


Fixed submission:
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    ans += 1
    min_p = i
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
for i in range(n)
  if p[i] < p[i+1]:
    p.pop(i+1)
print(p.count())

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    ans += 1
    min_p = i
print(ans)
Buggy python submission (verdict: Runtime Error):
A = str(input(''))
if A = 'a':
  print('b')
elif A = 'b':
  print('c')
elif A = 'c':
  print('d')
elif A = 'd':
  print('e')
elif A = 'e':
  print('f')
elif A = 'f':
  print('g')
elif A = 'g':
  print('h')
elif A = 'h':
  print('i')
elif A = 'i':
  print('j')
elif A = 'j':
  print('k')
elif A = 'k':
  print('l')
elif A = 'l':
  print('m')
elif A = 'm':
  print('n')
elif A = 'n':
  print('o')
elif A = 'o':
  print('p')
elif A = 'p':
  print('q')
elif A = 'q':
  print('r')
elif A = 'r':
  print('s')
elif A = 's':
  print('t')
elif A = 't':
  print('u')
elif A = 'u':
  print('v')
elif A = 'v':
  print('w')
elif A = 'w':
  print('x')
elif A = 'x':
  print('y')
else:
  print('z')



Fixed submission:
A = str(input(''))
if A == 'a':
  print('b')
elif A == 'b':
  print('c')
elif A == 'c':
  print('d')
elif A == 'd':
  print('e')
elif A == 'e':
  print('f')
elif A == 'f':
  print('g')
elif A == 'g':
  print('h')
elif A == 'h':
  print('i')
elif A == 'i':
  print('j')
elif A == 'j':
  print('k')
elif A == 'k':
  print('l')
elif A == 'l':
  print('m')
elif A == 'm':
  print('n')
elif A == 'n':
  print('o')
elif A == 'o':
  print('p')
elif A == 'p':
  print('q')
elif A == 'q':
  print('r')
elif A == 'r':
  print('s')
elif A == 's':
  print('t')
elif A == 't':
  print('u')
elif A == 'u':
  print('v')
elif A == 'v':
  print('w')
elif A == 'w':
  print('x')
elif A == 'x':
  print('y')
else:
  print('z')

Buggy python submission (verdict: Runtime Error):
A = input()
if A = 'a':
  print('b')
elif A = 'b':
  print('c')
elif A = 'c':
  print('d')
elif A = 'd':
  print('e')
elif A = 'e':
  print('f')
elif A = 'f':
  print('g')
elif A = 'g':
  print('h')
elif A = 'h':
  print('i')
elif A = 'i':
  print('j')
elif A = 'j':
  print('k')
elif A = 'k':
  print('l')
elif A = 'l':
  print('m')
elif A = 'm':
  print('n')
elif A = 'n':
  print('o')
elif A = 'o':
  print('p')
elif A = 'p':
  print('q')
elif A = 'q':
  print('r')
elif A = 'r':
  print('s')
elif A = 's':
  print('t')
elif A = 't':
  print('u')
elif A = 'u':
  print('v')
elif A = 'v':
  print('w')
elif A = 'w':
  print('x')
elif A = 'x':
  print('y')
else:
  print('z')



Fixed submission:
A = str(input(''))
if A == 'a':
  print('b')
elif A == 'b':
  print('c')
elif A == 'c':
  print('d')
elif A == 'd':
  print('e')
elif A == 'e':
  print('f')
elif A == 'f':
  print('g')
elif A == 'g':
  print('h')
elif A == 'h':
  print('i')
elif A == 'i':
  print('j')
elif A == 'j':
  print('k')
elif A == 'k':
  print('l')
elif A == 'l':
  print('m')
elif A == 'm':
  print('n')
elif A == 'n':
  print('o')
elif A == 'o':
  print('p')
elif A == 'p':
  print('q')
elif A == 'q':
  print('r')
elif A == 'r':
  print('s')
elif A == 's':
  print('t')
elif A == 't':
  print('u')
elif A == 'u':
  print('v')
elif A == 'v':
  print('w')
elif A == 'w':
  print('x')
elif A == 'x':
  print('y')
else:
  print('z')
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
L = [0]*n
AC = 0
WA = 0
tmp = [0]*n
for i in range(m):
	x,y = input().split()
	x = int(x)
	if L[x-1] == 0:
		if y == "WA":
			tmp[x-1] += 1
		else:
			AC += 1
			WA += tmp[x-1]
			L[x-1]=1
print(A,W)


Fixed submission:
n,m = map(int,input().split())
L = [0]*n
AC = 0
WA = 0
tmp = [0]*n
for i in range(m):
	x,y = input().split()
	x = int(x)
	if L[x-1] == 0:
		if y == "WA":
			tmp[x-1] += 1
		else:
			AC += 1
			WA += tmp[x-1]
			L[x-1]=1
print(AC,WA)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = str(inout())
print(s.count('ABC'))

Fixed submission:
n = int(input())
s = str(input())
print(s.count('ABC'))
Buggy python submission (verdict: Runtime Error):
from itertools import permutations
n = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))

A = [i for i in range(1,n+1)]

for i,per in enumerate(list(permutations(A))):
  if per == P:
    x = i
  if per == Q:
    y = i
  
print(abs(x-y))


Fixed submission:
from itertools import permutations
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

a = [i+1 for i in range(n)]
for i,per in enumerate(list(permutations(a))):
    if per == p:
        x = i
    if per == q:
        y = i
print(abs(x-y))

Buggy python submission (verdict: Runtime Error):
from itertools import permutations
n = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))

A = [i+1 for i in range(n)]



for i,per in enumerate(list(permutations(A))):
  if per == P:
    x = i
  if per == Q:
    y = i
  
print(abs(x-y))


Fixed submission:
from itertools import permutations
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

a = [i+1 for i in range(n)]
for i,per in enumerate(list(permutations(a))):
    if per == p:
        x = i
    if per == q:
        y = i
print(abs(x-y))

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

A = [i+1 for i in range(N)]

from itertools import permutations

for i,per in enumerate(list(permutations(A))):
  if per == P:
    x = i
  if per == Q:
    y = i
  
print(abs(x-y))

Fixed submission:
from itertools import permutations
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

a = [i+1 for i in range(n)]
for i,per in enumerate(list(permutations(a))):
    if per == p:
        x = i
    if per == q:
        y = i
print(abs(x-y))

Buggy python submission (verdict: Runtime Error):
import permutations
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

a = [i+1 for i in range(n)]
for i,per in enumerate(list(permutations(a))):
    if per == p:
        x = i
    if per == q:
        y = i
print(abs(x-y))


Fixed submission:
from itertools import permutations
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

a = [i+1 for i in range(n)]
for i,per in enumerate(list(permutations(a))):
    if per == p:
        x = i
    if per == q:
        y = i
print(abs(x-y))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
ans = []
for i in range(0,n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      a = s[i]+s[j]+s[k]
      ans.append(a)
ans = set(ans)
print(len(ans))


Fixed submission:
n = int(input())
s = input()
lst = [0] * 1000
for i in range(1000):
    if len(str(i)) == 1:
        tmp = '00' + str(i)
        lst[i] = tmp
    elif len(str(i)) == 2:
        tmp = '0' + str(i)
        lst[i] = tmp
    else:
        lst[i] = str(i)

cnt = 0
for v in lst:
    id_1 = s.find(v[0])
    if id_1 == -1:
        continue
    id_2 = s.find(v[1], id_1 + 1)
    if id_2 == -1:
        continue
    id_3 = s.find(v[2], id_2 + 1)
    if id_3 == -1:
        continue
    cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = []
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      a = s[i]+s[j]+s[k]
      ans.apeend(a)
ans = set(ans)
print(len(ans))

Fixed submission:
n = int(input())
s = input()
lst = [0] * 1000
for i in range(1000):
    if len(str(i)) == 1:
        tmp = '00' + str(i)
        lst[i] = tmp
    elif len(str(i)) == 2:
        tmp = '0' + str(i)
        lst[i] = tmp
    else:
        lst[i] = str(i)

cnt = 0
for v in lst:
    id_1 = s.find(v[0])
    if id_1 == -1:
        continue
    id_2 = s.find(v[1], id_1 + 1)
    if id_2 == -1:
        continue
    id_3 = s.find(v[2], id_2 + 1)
    if id_3 == -1:
        continue
    cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a == b == 1:
  print(1000000)
elif a < 3:
  if b < 3:
    print(100000*(4-a)+100000*(4-b))
  else:
    print(1000000*(4-a))
else:
  if b < 3:
    print(1000000*(4-b)
  else:print(0)

Fixed submission:
X, Y = map(int, input().split())
tmp=0
if X==1 and Y==1:
    tmp+=400000

for i in (X, Y):
    if i==1:
        tmp+=300000
    elif i==2:
        tmp+=200000
    elif i==3:
        tmp+=100000
print(tmp)
Buggy python submission (verdict: Runtime Error):
N = int(input())
import math

XY = [[int(x) for x in input().rstrip().split()] for i in range(N)]

ans = 0
for i in range(N):
  for j in range(N):
    if i < j:
      ans += math.sqrt((XY[i][0]-XY[j][0])**2+(XY[i][1]-XY[j][1])**2)
bb = 1
for i in range(1,N+1):
  bb* = i

print(2*ans/N)


Fixed submission:
N=int(input())
import math

XY=[[int(x) for x in input().rstrip().split()] for i in range(N)]

ans=0
for i in range(N):
  for j in range(N):
    if i<j:
      ans+=math.sqrt((XY[i][0]-XY[j][0])**2+(XY[i][1]-XY[j][1])**2)
bb=1
for i in range(1,N+1):
  bb*=i

print(2*ans/N)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ma = 10**100
for i in range(1, 10**6+2):
  if N % i == 0:
    ma = min(ma,((i-1)+(n//i)-1))
print(ma)


Fixed submission:
n = int(input())
ma = 10**100
for i in range(1, 10**6+2):
  if n % i == 0:
    ma = min(ma,((i-1)+(n//i)-1))
print(ma)
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(n):
  for j in range(i+1,n+1):
    ans += d[i]*d[j]
print(ans)

Fixed submission:
N=int(input())
D=list(map(int,input().split()))
print((sum(D)**2-sum(d*d for d in D))//2)
Buggy python submission (verdict: Time Limit Exceeded):
import collections

n = int(input())
L = sorted(map(int,input().split()))
ans = []
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]:
        A = [i,j,k]
        A.sort()
        s = ''.join([str(n) for n in A])
        ans.append(s)
cnt = set(ans)  
print(len(cnt))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
count = 0

for i in range(N-1,0,-1):
    l = 0
    r = i -1
    while(l< r):
        if (A[l] + A[r] >A[i]):
            count += (r-l)
            r -= 1
        else:
            l += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a = int(input)
if a % 2 == 0:
  print(0.5)
else:
  print(((a+1)//2) / a)

Fixed submission:
a = int(input())
if a % 2 == 0:
  print(0.5)
else:
  print(((a+1)//2) / a)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
ans = 0
a = list[map(int,input().split())]
for i in range(n):
  if a[i] >= k:
    ans += 1
print(ans)

Fixed submission:
n,k = map(int,input().split())
ans = 0
a = list(map(int,input().split()))
for i in range(n):
  if a[i] >= k:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
if n == Sunny:
  print('Cloudy')
elif n == Cloudy:
  print('Rainy')
else:
  print('Sunny')

Fixed submission:
n = input()
if n == 'Sunny':
  print('Cloudy')
elif n == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
Buggy python submission (verdict: Runtime Error):
n,k,q = map(int,input().split())
l = [0]*q
for _ in range(q):
  a = int(input())
  l[a-1] = +1
for i in range(len(q)):
  if l[i] >= 1:
    print('Yes')
  else:
    print('No')

Fixed submission:
n,k,q=map(int,input().split())
a=[int(input()) for i in range(q)]
p=[0]*n
for i in a:
  p[i-1]+=1
for j in p:
  if k-(q-j)>0:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = 1 
ans = 0
for i in range():
  if c >= b:
    break
  else:
    c += a-1
    ans += 1
print(ans)

Fixed submission:
a,b = map(int,input().split())
c = 1 
ans = 0
while c < b:
  c += a-1
  ans += 1
print(ans)