Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def resolve():

    N,M = map(int,input().split())
    ab =[map(int,input().split()) for _ in range(N)]
    branch = [[] for _ in range(N)]
    for a,b in ab:
        branch[a-1].append(b-1)
        branch[b-1].append(a-1)
    
    bit = 0
    count = 0
    def walk(p):
        nonlocal bit,N
        bit |= (1 << p)
        if bit == 2 ** N - 1:
            nonlocal count
            count += 1
        for n in branch[p]:
            if not(bit & (1 << n)):
                walk(n)
        bit &= ~(1 << p)

    walk(0)
    print(count)
resolve()

Fixed submission:
def resolve():
    import sys
    sys.setrecursionlimit(10**6)
    
    N,M = map(int,input().split())
    ab =[map(int,input().split()) for _ in range(M)]
    branch = [[] for _ in range(N)]
    for a,b in ab:
        branch[a-1].append(b-1)
        branch[b-1].append(a-1)
    
    bit = 0
    count = 0
    def walk(p):
        nonlocal bit,N
        bit |= (1 << p)
        if bit == 2 ** N - 1:
            nonlocal count
            count += 1
        for n in branch[p]:
            if not(bit & (1 << n)):
                walk(n)
        bit &= ~(1 << p)

    walk(0)
    print(count)
resolve()
Buggy python submission (verdict: Runtime Error):
N,K,L = map(int,input().split())

root_road = list(range(N))
root_rail = list(range(N))
depth_road = [1 for _ in range(N)]
depth_rail = [1 for _ in range(N)]

def find(a,root):
    if root[a] == a:
        return a
    else:
        root[a] = find(root[a],root)
        return root[a]

def unite(a,b,root,depth):
    A = find(a,root)
    B = find(b,root)
    if A == B:
        return
    elif depth[A] > depth[B]:
        root[B] = A
        depth[A] += depth[B]
    else:
        root[A] = B
        depth[B] += depth[A]

for i in range(K):
    p,q = map(int,input().split())
    unite(p-1,q-1,root_road,depth_road)
for i in range(L):
    r,s = map(int,input().split())
    unite(r-1,s-1,root_rail,depth_rail)
d = defaultdict(int)
pairs = []
for i in range(N):
    road = find(i,root_road)
    rail = find(i,root_rail)
    pairs.append((road,rail))
    d[(road,rail)] += 1
for p in pairs:
    print(d[p],end = " ")

Fixed submission:
from collections import defaultdict
N,K,L = map(int,input().split())

root_road = list(range(N))
root_rail = list(range(N))
depth_road = [1 for _ in range(N)]
depth_rail = [1 for _ in range(N)]

def find(a,root):
    if root[a] == a:
        return a
    else:
        root[a] = find(root[a],root)
        return root[a]

def unite(a,b,root,depth):
    A = find(a,root)
    B = find(b,root)
    if A == B:
        return
    elif depth[A] > depth[B]:
        root[B] = A
        depth[A] += depth[B]
    else:
        root[A] = B
        depth[B] += depth[A]

for i in range(K):
    p,q = map(int,input().split())
    unite(p-1,q-1,root_road,depth_road)
for i in range(L):
    r,s = map(int,input().split())
    unite(r-1,s-1,root_rail,depth_rail)
d = defaultdict(int)
pairs = []
for i in range(N):
    road = find(i,root_road)
    rail = find(i,root_rail)
    pairs.append((road,rail))
    d[(road,rail)] += 1
for p in pairs:
    print(d[p],end = " ")
Buggy python submission (verdict: Runtime Error):
from _collections import deque
from _ast import Num


def parser():
    while 1:
        data = list(input().split(' '))
        for number in data:
            if len(number) > 0:
                yield (number)


input_parser = parser()


def gw():
    global input_parser
    return next(input_parser)


def gi():
    data = gw()
    return int(data)


MOD = int(1e9 + 7)

import numpy
from collections import deque
from math import sqrt
from math import floor
import heapq
#https://atcoder.jp/contests/abc148/tasks/abc148_f
#F - Playing Tag on Tree
"""
"""
N = gi()
u = gi()
v = gi()
t = [[] for i in range(N + 1)]
d = [[0 for i in range(2)] for j in range(N + 1)]

for _ in range(1, N):
    a = gi()
    b = gi()
    t[a].append(b)
    t[b].append(a)

ls = []


def dfs(i, p, di):

    if len(t[i]) == 1:
        ls.append(i)
    for nei in t[i]:
        if nei == p:
            continue
        d[nei][di] = d[i][di] + 1
        dfs(nei, i, di)


d[u][0] = 0
dfs(u, -1, 0)
d[v][1] = 0
dfs(v, -1, 1)

ans = 0
for l in ls:
    du = d[l][0]
    dv = d[l][1]
    if dv >= du:
        ans = max(ans, dv - 1)

print(ans)


Fixed submission:
from _collections import deque
from _ast import Num


def parser():
    while 1:
        data = list(input().split(' '))
        for number in data:
            if len(number) > 0:
                yield (number)


input_parser = parser()


def gw():
    global input_parser
    return next(input_parser)


def gi():
    data = gw()
    return int(data)


MOD = int(1e9 + 7)

import numpy
from collections import deque
from math import sqrt
from math import floor
import heapq
#https://atcoder.jp/contests/abc148/tasks/abc148_f
#F - Playing Tag on Tree
"""
"""
N = gi()
U = gi()
V = gi()
t = [[] for i in range(N + 1)]
d = [[-1 for i in range(2)] for j in range(N + 1)]

for _ in range(1, N):
    a = gi()
    b = gi()
    t[a].append(b)
    t[b].append(a)


def bfs(s, di):
    d[s][di] = 0
    q = deque()
    q.append(s)
    while len(q):
        v = q.pop()
        for u in t[v]:
            if d[u][di] >= 0:
                continue
            d[u][di] = d[v][di] + 1
            q.append(u)


bfs(U, 0)
bfs(V, 1)

ans = 0
for l in range(1, N + 1):
    if len(t[l]) > 1:
        continue
    du = d[l][0]
    dv = d[l][1]
    #print(l, du, dv)
    if dv >= du:
        ans = max(ans, dv - 1)

print(ans)
Buggy python submission (verdict: Runtime Error):
from _collections import deque
from _ast import Num


def parser():
    while 1:
        data = list(input().split(' '))
        for number in data:
            if len(number) > 0:
                yield (number)


input_parser = parser()


def gw():
    global input_parser
    return next(input_parser)


def gi():
    data = gw()
    return int(data)


MOD = int(1e9 + 7)

import numpy
from collections import deque
from math import sqrt
from math import floor
# https://atcoder.jp/contests/arc081/tasks/arc081_b
# D - Coloring Dominoes
"""
need to consider the case that ticket is not enough to lower everything
"""

N = gi()
M = gi()
A = [0] * N
ops = []

for i in range(N):
    A[i] = gi()
for _ in range(M):
    b = gi()
    c = gi()
    ops.append((-c, b))

A.sort()
ops.sort()

i = 0
for op in ops:
    nv = -op[0]
    for _ in range(op[1]):
        if nv < A[i]:
            break
        if i >= N:
            break
        A[i] = nv
        i += 1

print(sum(A))


Fixed submission:
from _collections import deque
from _ast import Num


def parser():
    while 1:
        data = list(input().split(' '))
        for number in data:
            if len(number) > 0:
                yield (number)


input_parser = parser()


def gw():
    global input_parser
    return next(input_parser)


def gi():
    data = gw()
    return int(data)


MOD = int(1e9 + 7)

import numpy
from collections import deque
from math import sqrt
from math import floor
# https://atcoder.jp/contests/arc081/tasks/arc081_b
# D - Coloring Dominoes
"""
need to consider the case that ticket is not enough to lower everything
"""

N = gi()
M = gi()
A = [0] * N
ops = []

for i in range(N):
    A[i] = gi()
for _ in range(M):
    b = gi()
    c = gi()
    ops.append((-c, b))

A.sort()
ops.sort()

i = 0
for op in ops:
    nv = -op[0]
    for _ in range(op[1]):
        if i >= N:
            break
        if nv < A[i]:
            break
        A[i] = nv
        i += 1

print(sum(A))
Buggy python submission (verdict: Runtime Error):
from _collections import deque
from _ast import Num


def parser():
    while 1:
        data = list(input().split(' '))
        for number in data:
            if len(number) > 0:
                yield (number)


input_parser = parser()


def gw():
    global input_parser
    return next(input_parser)


def gi():
    data = gw()
    return int(data)


MOD = int(1e9 + 7)

import numpy
from collections import deque
from math import sqrt
from math import floor
import heapq
# https://atcoder.jp/contests/agc033/tasks/agc033_b
# B - LRUD Game
"""
"""
N = gi()
M = gi()
g = [[] for i in range(N + 1)]

for i in range(M):
    x = gi()
    y = gi()
    z = gi()
    g[x].append(y)
    g[y].append(x)

visited = [0] * (N + 1)


def dfs(v):
    if visited[v]:
        return
    visited[v] = 1

    for u in g[v]:
        dfs(u)


ans = 0
for v in range(1, N + 1):
    if visited[v]:
        continue
    ans += 1
    dfs(v)

print(ans)


Fixed submission:
from _collections import deque
from _ast import Num


def parser():
    while 1:
        data = list(input().split(' '))
        for number in data:
            if len(number) > 0:
                yield (number)


input_parser = parser()


def gw():
    global input_parser
    return next(input_parser)


def gi():
    data = gw()
    return int(data)


MOD = int(1e9 + 7)

import numpy
from collections import deque
from math import sqrt
from math import floor
import heapq
# https://atcoder.jp/contests/agc033/tasks/agc033_b
# B - LRUD Game
"""
"""
N = gi()
M = gi()
parent = [[] for i in range(N + 1)]


def find(a):
    if parent[a] != a:
        parent[a] = find(parent[a])

    return parent[a]


def union(a, b):
    aP = find(a)
    bP = find(b)

    if (aP != bP):
        parent[max(aP, bP)] = min(aP, bP)


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

for i in range(M):
    x = gi()
    y = gi()
    z = gi()
    union(x, y)

ans = 0

for i in range(1, N + 1):
    if find(i) == i:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, raw_input().split())

if n > m: swap(n, m)

if n == 1:
	if m == 1:
		print 1
	else:
		print m - 2 
	exit(0)

black = (n - 2) * (m - 2)
print black

Fixed submission:
n, m = map(int, raw_input().split())

if n > m: 
	a = n
	n = m
	m = a

if n == 1:
	if m == 1:
		print 1
	else:
		print m - 2 
	exit(0)

black = (n - 2) * (m - 2)
print black
Buggy python submission (verdict: Runtime Error):
import sys

n = int(sys.stdin.readline().rstrip("\n"))
count = 0
for num in range(27, n+1, 2):
    divisor = 1
    for p in range(1, num, 2):
        if num % p == 0:
            print(f"num: {num}, p: {p}")
            divisor += 1
    if divisor == 8:
        count += 1
print(count)


Fixed submission:
import sys

n = int(sys.stdin.readline().rstrip("\n"))
count = 0
for num in range(27, n+1, 2):
    divisor = 1
    for p in range(1, num, 2):
        if num % p == 0:
            divisor += 1
    if divisor == 8:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
    h=int(input())
    w=int(input())
    n=int(input())
     
    if h>w:
      if n%h==0:
        ct=n//h
      else:
        ct=n//h+1
    else:
      if n%w==0:
        ct=n//w
      else:
        ct=n//w+1
    print(ct)

Fixed submission:
h=int(input())
w=int(input())
n=int(input())         
if h>w:
  if n%h==0:
    ct=n//h
  else:
    ct=n//h+1
else:
  if n%w==0:
    ct=n//w
  else:
    ct=n//w+1
print(ct)

Buggy python submission (verdict: Runtime Error):
h=int(input())
w=int(input())
n=int(input())
 
if h>w:
  if n%h==0:
    ct=n//h
  else:
    ct=n//h+1
else:
  if n%w=0:
    ct=n//w
  else:
    ct=n//w+1
print(ct)

Fixed submission:
h=int(input())
w=int(input())
n=int(input())         
if h>w:
  if n%h==0:
    ct=n//h
  else:
    ct=n//h+1
else:
  if n%w==0:
    ct=n//w
  else:
    ct=n//w+1
print(ct)
Buggy python submission (verdict: Runtime Error):
n,y = map(int,input().split())
s=[-1,-1,-1]
if n*10000<y:
    pass
elif n*10000==y:
    s=[n,0,0]
else:
    m=1
    x=n*10000
    while m<=n:
        for i in range(m+1):
            x= x-9000*(m-i)-4000*i
            if x == y:
                s=[n-m,i,m-i]
                break
        if x==y:
            break
    m=m+1
print(*l)

Fixed submission:
n,y = map(int,input().split())
s=[-1,-1,-1]
if n*10000<y:
    pass
elif n*10000==y:
    s=[n,0,0]
else:
    m=1
    x_0=n*10000
    while m<=n:
        for i in range(m+1):
            x= x_0-9000*(m-i)-5000*i
            if x == y:
                s=[n-m,i,m-i]
                break
        if x==y:
            break
        m=m+1
print(*s)

Buggy python submission (verdict: Runtime Error):
n,y = map(int,input().split())
s=[-1,-1,-1]
if n*10000<y:
    pass
else:
    m=0
    x=n*10000
    while m<=n:
        for i in range(m):
            x= x-9000*(m-i)-4000*i
            if x == y:
                s=[n-m,i,m-i]
                break
        if x==y:
            break
print(*l)
                

Fixed submission:
n,y = map(int,input().split())
s=[-1,-1,-1]
if n*10000<y:
    pass
elif n*10000==y:
    s=[n,0,0]
else:
    m=1
    x_0=n*10000
    while m<=n:
        for i in range(m+1):
            x= x_0-9000*(m-i)-5000*i
            if x == y:
                s=[n-m,i,m-i]
                break
        if x==y:
            break
        m=m+1
print(*s)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input())
if a%3==0 or b%3==0 or (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")

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

for i in range(n):
  sum = sum+a[i]
  d[i] = sum
for i in range(n):
  d[i] = abs(sum[i]-d[i])
d.pop(0)
d.pop(n-1)
print(min(d))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
s =0
d = list(range(n))
for i in range(n):
    s = s+a[i]
    d[i] = s
# print(s)
# print(d)
for i in range(n):
    d[i] = abs(2*d[i]-s)
# print(d)
d.pop(n-1)
print(min(d))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
a = "SS"
ct=1
while ct<7:    
    for i in range(n-1):
        p=a[i]
        q="A"
        if a[i]=="S":
            q="W"
        else:
            q="S"
        if a[i+1]=="S":
            if s[i+1] == "o":
                a=a+a[i]
            else:
                a=a+q
        else:
            if s[i+1] == "o":
                 a=a+q
            else:
                a=a+a[i]
    if a[0]==a[n]:
        if a[0]=="S":
            if s[0]=="o":
                if a[n-1]==a[1]:
                    print(a[0:n])
                    break
                else:
                    pass
            else:
                if a[n-1]==a[1]:
                    pass
                else:
                    print(a[0:n])
                    break
        else:
            if s[0]=="o":
                if a[n-1]==a[1]:
                    pass
                else:
                    print(a[0:n])
                    break
            else:
                if a[n-1]==a[1]:
                    print(a[0:n])
                    break
                else:
                    pass
    else:
        ct=ct+1
        if ct==2:
            a="SW"
        elif ct==3:
            a="WS"
        elif ct==4:
            a="WW"
        else:
            print(-1)
            break

Fixed submission:
n = int(input())
s = input()
a = "SS"
ct=1
while ct<7:    
    for i in range(n-1):
        p=a[i]
        q="A"
        if a[i]=="S":
            q="W"
        else:
            q="S"
        if a[i+1]=="S":
            if s[i+1] == "o":
                a=a+a[i]
            else:
                a=a+q
        else:
            if s[i+1] == "o":
                 a=a+q
            else:
                a=a+a[i]
    if a[0]==a[n]:
        if a[0]=="S" and s[0]=="o" and a[n-1]==a[1]:
            print(a[0:n])
            break
        elif a[0]=="S" and s[0] !="o" and a[n-1]!=a[1]:         
            print(a[0:n])
            break
        elif a[0]=="W" and s[0] =="o" and a[n-1]!=a[1]: 
            print(a[0:n])
            break
        elif a[0]=="W" and s[0] !="o" and a[n-1]==a[1]: 
            print(a[0:n])
            break
        else:
            ct=ct+1
        if ct==2:
            a="SW"
        elif ct==3:
            a="WS"
        elif ct==4:
            a="WW"
        else:
            print(-1)
            break
    else:
        ct=ct+1
        if ct==2:
            a="SW"
        elif ct==3:
            a="WS"
        elif ct==4:
            a="WW"
        else:
            print(-1)
            break
Buggy python submission (verdict: Runtime Error):
Menagerien = int(input())
s = input()
a = "SS"
ct=1
while ct<7:    
    for i in range(n-1):
        p=a[i]
        q="A"
        if a[i]=="S":
            q="W"
        else:
            q="S"
        if a[i+1]=="S":
            if s[i+1] == "o":
                a=a+a[i]
            else:
                a=a+q
        else:
            if s[i+1] == "o":
                 a=a+q
            else:
                a=a+a[i]
    if a[0]==a[n]:
        if a[0]=="S" and s[0]=="o" and a[n-1]==a[1]:
            print(a[0:n])
            break
        elif a[0]=="S" and s[0] !="o" and a[n-1]!=a[1]:         
            print(a[0:n])
            break
        elif a[0]=="W" and s[0] =="o" and a[n-1]!=a[1]: 
            print(a[0:n])
            break
        elif a[0]=="W" and s[0] !="o" and a[n-1]==a[1]: 
            print(a[0:n])
            break
        else:
            ct=ct+1
        if ct==2:
            a="SW"
        elif ct==3:
            a="WS"
        elif ct==4:
            a="WW"
        else:
            print(-1)
            break
    else:
        ct=ct+1
        if ct==2:
            a="SW"
        elif ct==3:
            a="WS"
        elif ct==4:
            a="WW"
        else:
            print(-1)
            break

Fixed submission:
n = int(input())
s = input()
a = "SS"
ct=1
while ct<7:    
    for i in range(n-1):
        p=a[i]
        q="A"
        if a[i]=="S":
            q="W"
        else:
            q="S"
        if a[i+1]=="S":
            if s[i+1] == "o":
                a=a+a[i]
            else:
                a=a+q
        else:
            if s[i+1] == "o":
                 a=a+q
            else:
                a=a+a[i]
    if a[0]==a[n]:
        if a[0]=="S" and s[0]=="o" and a[n-1]==a[1]:
            print(a[0:n])
            break
        elif a[0]=="S" and s[0] !="o" and a[n-1]!=a[1]:         
            print(a[0:n])
            break
        elif a[0]=="W" and s[0] =="o" and a[n-1]!=a[1]: 
            print(a[0:n])
            break
        elif a[0]=="W" and s[0] !="o" and a[n-1]==a[1]: 
            print(a[0:n])
            break
        else:
            ct=ct+1
            if ct==2:
                a="SW"
            elif ct==3:
                a="WS"
            elif ct==4:
                a="WW"
            else:
                print(-1)
                break
    else:
        ct=ct+1
        if ct==2:
            a="SW"
        elif ct==3:
            a="WS"
        elif ct==4:
            a="WW"
        else:
            print(-1)
            break
Buggy python submission (verdict: Runtime Error):
A = input()
B = input()

A = int(A)
B = int(B)

if A > B:
  print(B)
else:
  print(0)

Fixed submission:
AB = input()
A,B=AB.split()
A = int(A)
B = int(B)

if A > 2*B:
  print(A-2*B)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
N = input()
A = input()
B = input()

N = int(N)
A = int(A)
B = int(B)

if N * A > B:
  print(N*A)
else:
  print(B)

Fixed submission:
NAB = input()
N,A,B=NAB.split()
N = int(N)
A = int(A)
B = int(B)

if N * A < B:
  print(N*A)
else:
  print(B)
Buggy python submission (verdict: Runtime Error):
a = input() 
b = input()

a=int(a)
b=int(b)

if (a * b)/2 = 0:
  print('Even')
else:
  print('Odd')

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

if (a * b)%2 == 0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
r=input()
g=input()
b=input()

r=int(r)
g=int(g)
b=int(b)

if print(rgb)/4=0:
  return 'Yes'
else:
  return 'No'

Fixed submission:
r,g,b,=input().split()
r=int(r)
g=int(g)
b=int(b)

if ((r*100)+(g*10)+b)%4==0:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
n=int(input())
re=0
for i in range(1,n):
  if len(str(i)%2==1):
    re+=1
print(re)

Fixed submission:
n=int(input())
re=0
for i in range(1,n+1):
  if len(str(i))%2==1:
    re+=1
print(re)

Buggy python submission (verdict: Runtime Error):
import math
def main():
	n=int(input())
	a=round(math.log10(n))
	count=0
	result=0
		while count<=a:
			if a<=1:
				result += n+1
				break
			else:
			if count==a:
				result += n-10**count + 1
				count += 2
			else:
				if  count==0:
					result+=10
					count +=2
				else:
					result += 10**(count+1)-10**count
					count += 2
	aaa=result-1
	print(aaa)
main()

Fixed submission:
n=int(input())
re=0
for i in range(1,n+1):
  if len(str(i))%2==1:
    re+=1
print(re)

Buggy python submission (verdict: Runtime Error):
import math
def main():
	n=int(input())
	a=round(math.log10(n))
	count=0
	result=0
		while count<=a:
			if a<=1:
				result += n+1
				break
			else:
			if count==a:
				result += n-10**count + 1
				count += 2
			else:
				if  count==0:
					result+=10
					count +=2
				else:
					result += 10**(count+1)-10**count
					count += 2
	aaa=result-1
	print(aaa)
main()

Fixed submission:
n=int(input())
re=0
for i in range(1,n+1):
  if len(str(i))%2==1:
    re+=1
print(re)

Buggy python submission (verdict: Runtime Error):
result=0
while count<=a:
	if a<=1:
		result += n+1
		break
	else:
		if count==a:
			result += n-10**count + 1
			count += 2
		else:
			if  count==0:
				result+=10
				count +=2
			else:
				result += 10**(count+1)-10**count
				count += 2
print(result-1)

Fixed submission:
n=int(input())
re=0
for i in range(1,n+1):
  if len(str(i))%2==1:
    re+=1
print(re)
Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split())).sort()
if a==[5,5,7]:
  print(YES)
  else:
    print(NO)
    
    

Fixed submission:
a=list(map(int,input().split()))
a.sort() 
if a==[5,5,7]:
  print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
s = [input().strip("\"") for i in range(a)]
print("".join(s)) 

Fixed submission:
a=list(map(int,input().split()))
a.sort() 
if a==[5,5,7]:
  print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
def main(h, w, n)
  n_push = []

  for n_h in range(h):
    for n_w in range(w):
      n_tmp = n_h*w + n_w*h - (n_h*n_w)

      if n_tmp>n_push:
          n_push.append = n_h + n_w

  return min(n_push)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())

n_push = []

for n_h in range(h+1):
  for n_w in range(w+1):
    n_tmp = (n_h)*w + (n_w)*h - ((n_h)*(n_w))

    if n_tmp>=n:
      n_push.append(n_h + n_w)

print(min(n_push))

Buggy python submission (verdict: Runtime Error):
h = 14
w = 12
n = 112

n_push = []

for n_h in range(h):
  for n_w in range(w):
    n_tmp = n_h*w + n_w*h - (n_h*n_w)
    
    if n_tmp>n_push:
	    n_push.append = n_h + n_w
    
print min(n_push)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())

n_push = []

for n_h in range(h+1):
  for n_w in range(w+1):
    n_tmp = (n_h)*w + (n_w)*h - ((n_h)*(n_w))

    if n_tmp>=n:
      n_push.append(n_h + n_w)

print(min(n_push))

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

ans = 0
sum = 0

while(sum < n):
  if h >= w :
    sum += h
    ans += 1
    w -= 1
  else :
    sum += w
    asn += 1
    h -= 1
print(ans)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())
 
ans = 0
sum = 0
 
while(sum < n):
  if h >= w :
    sum += h
    ans += 1
    w -= 1
  else :
    sum += w
    ans += 1
    h -= 1
print(ans)
Buggy python submission (verdict: Runtime Error):
day = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

in_day = input();

if in_day == day[x]:
  print(7 - x)
  
  

Fixed submission:
S = input()

days = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

print(7 - days.index(S))