Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
class Dice:
    def __init__(self, labels):
        self.labels = labels
    def east(self):
        self.labels[1], self.labels[2], self.labels[3], self.labels[4] = self.labels[3], self.labels[1], self.labels[4], self.labels[2]
    def west(self):
        self.labels[1], self.labels[2], self.labels[3], self.labels[4] = self.labels[2], self.labels[4], self.labels[1], self.labels[3]
    def north(self):
        self.labels[0], self.labels[1], self.labels[4], self.labels[5] = self.labels[1], self.labels[5], self.labels[0], self.labels[4]
    def south(self):
        self.labels[0], self.labels[1], self.labels[4], self.labels[5] = self.labels[4], self.labels[0], self.labels[5], self.labels[1]
    
    def clockwise(self):
        self.labels[1], self.labels[2], self.labels[4], self.labels[3] = self.labels[2], self.labels[4], self.labels[3], self.labels[1]

dice = Dice(list(map(int, input().split())))

for n in range(int(input())):
    top, foward = map(int, input().split())
    south_cnt = 0

    while True:
        if foward == dice.labels[1] and top == dice.labels[0]:
            break
        if foward == dice.labels[1]:
            dice.east()
        elif top == dice.labels[0]:
            dice.clockwise()
        else:
            if south_cnt == 3:
                dice.east()
            else:
                dice.south()
                south_cnt += 1
    print(dice.labels[2])




Fixed submission:
class Dice:
    def __init__(self, labels):
        self.labels = labels
    def east(self):
        self.labels[0], self.labels[2], self.labels[5], self.labels[3] = self.labels[3], self.labels[0], self.labels[2], self.labels[5]
    def west(self):
        self.labels[0], self.labels[2], self.labels[5], self.labels[3] = self.labels[2], self.labels[5], self.labels[3], self.labels[0]
    def north(self):
        self.labels[0], self.labels[1], self.labels[5], self.labels[4] = self.labels[1], self.labels[5], self.labels[4], self.labels[0]
    def south(self):
        self.labels[0], self.labels[1], self.labels[5], self.labels[4] = self.labels[4], self.labels[0], self.labels[1], self.labels[5]

dice = Dice(list(map(int, input().split())))

for n in range(int(input())):
    top, foward = map(int, input().split())
    south_cnt = 0

    while True:
        #print(dice.labels[0], dice.labels[1], dice.labels[2], dice.labels[4], dice.labels[3])
        if foward == dice.labels[1] and top == dice.labels[0]:
            break
        if foward == dice.labels[1]:
            dice.east()
        elif top == dice.labels[0]:
            dice.south()
            dice.east()
            dice.north()
        else:
            if south_cnt == 3:
                dice.east()
            else:
                dice.south()
                south_cnt += 1
    print(dice.labels[2])
Buggy python submission (verdict: Runtime Error):
pow(input(), 3)

Fixed submission:
x = int(input())

print(pow(x, 3))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s_l = h_l = c_l = d_l = [1,2,3,4,5,6,7,8,9,10,11,12,13]

for i in range(0, n):
  mark, num = input().split()
  if mark == "S":
    s_l.remove(int(num))
  if mark == "H":
    h_l.remove(int(num))
  if mark == "C":
    c_l.remove(int(num))
  if mark == "D":
    d_l.remove(int(num))

for s in s_l:
  print("S {}".format(s))
for h in h_l:
  print("H {}".format(h))
for c in c_l:
  print("C {}".format(c))
for d in d_l:
  print("D {}".format(d))

Fixed submission:
n = int(input())
s_l = []
h_l = []
c_l = []
d_l = []
for i in range(1, 14):
  s_l.append(i)
  h_l.append(i)
  c_l.append(i)
  d_l.append(i)

for i in range(0, n):
  mark, num = input().split()
  if mark == "S":
    s_l.remove(int(num))
  if mark == "H":
    h_l.remove(int(num))
  if mark == "C":
    c_l.remove(int(num))
  if mark == "D":
    d_l.remove(int(num))

for s in s_l:
  print("S {}".format(s))
for h in h_l:
  print("H {}".format(h))
for c in c_l:
  print("C {}".format(c))
for d in d_l:
  print("D {}".format(d))
Buggy python submission (verdict: Time Limit Exceeded):
while True:
  n, x = map(int, [_ for _ in input().split()])
  cnt = 0
  if n == x == 0:
    break

  for n1 in range(1, n+1):
    for n2 in range(2, n+1):
      for n3 in range(3, n+1):
        if n1 != n2 and n2 != n3 and n3 != n1:
          if n1+n2+n3 == x and n1 < n2 < n3:
            cnt += 1

  print(cnt)

Fixed submission:
while True:
  n, x = map(int, [_ for _ in input().split()])
  cnt = 0
  if n == x == 0:
    break

  for n1 in range(1, n+1):
    for n2 in range(n1+1, n+1):
      for n3 in range(n2+1, n+1):
        if n1 != n2 and n2 != n3 and n3 != n1:
          if n1+n2+n3 == x:
            cnt += 1

  print(cnt)
Buggy python submission (verdict: Runtime Error):
while True:
  x = input()
  if x == 0:
    quit()

  print(sum([int(_) for _ in str(x)]))

Fixed submission:
while True:
  x = input()
  if x == '0':
    quit()

  print(sum([int(_) for _ in x]))
Buggy python submission (verdict: Runtime Error):
import string

alphabets = {k:0 for k in string.ascii_lowercase}

for c in input().lower():
  if c == ' ':
    continue
  alphabets[c] += 1

for c, n in sorted(alphabets.items()):
  print("{} : {}".format(c, n))

Fixed submission:
import string

alphabets = {k:0 for k in string.ascii_lowercase}

while True:
  try:
    for c in input().lower():
      if alphabets.get(c) is None:
        continue
      alphabets[c] += 1
  except:
    break
for c, n in sorted(alphabets.items()):
  print("{} : {}".format(c, n))
Buggy python submission (verdict: Runtime Error):
def countingsort(a,k):
    c=[0]*(k+1)
    n=len(a)
    for i in a:
        c[i]+=1
    for i in range(1,k+1):
        c[i]=c[i]+c[i-1]
    b=[0]*n
    for i in range(n-1,-1,-1):
        b[c[a[i]]-1]=a[i]
        c[a[i]]-=1
    return b
q=int(input())
a=list(map(int,input().split()))
ret=countingsort(a,q)
for i in range(len(ret)):
    if i!=len(ret)-1:
        print(ret[i],end=" ")
    else:
        print(ret[i])


Fixed submission:
def countingsort(a,k):
    c=[0]*(k+1)
    n=len(a)
    for i in a:
        c[i]+=1
    for i in range(1,k+1):
        c[i]=c[i]+c[i-1]
    b=[0]*n
    for i in range(n-1,-1,-1):
        b[c[a[i]]-1]=a[i]
        c[a[i]]-=1
    return b
o=int(input())
a=list(map(int,input().split()))
q=max(a)
ret=countingsort(a,q)
for i in range(o):
    if i!=o-1:
        print(ret[i],end=" ")
    else:
        print(ret[i])

Buggy python submission (verdict: Runtime Error):
def countingsort(a,k):
    c=[0]*(k+1)
    n=len(a)
    for i in a:
        c[i]+=1
    for i in range(1,k+1):
        c[i]=c[i]+c[i-1]
    b=[0]*n
    for i in range(n-1,-1,-1):
        b[c[a[i]]-1]=a[i]
        c[a[i]]-=1
    return b
o=int(input())
a=list(map(int,input().split()))
q=max(a)
ret=countingsort(a,q)
for i in range(n):
    if i!=n-1:
        print(ret[i],end=" ")
    else:
        print(ret[i])


Fixed submission:
def countingsort(a,k):
    c=[0]*(k+1)
    n=len(a)
    for i in a:
        c[i]+=1
    for i in range(1,k+1):
        c[i]=c[i]+c[i-1]
    b=[0]*n
    for i in range(n-1,-1,-1):
        b[c[a[i]]-1]=a[i]
        c[a[i]]-=1
    return b
o=int(input())
a=list(map(int,input().split()))
q=max(a)
ret=countingsort(a,q)
for i in range(o):
    if i!=o-1:
        print(ret[i],end=" ")
    else:
        print(ret[i])
Buggy python submission (verdict: Runtime Error):
i=inputraw()
cubic=i*i*i
print cubic

Fixed submission:
i=int(input())
cubic=i*i*i
print(cubic)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print a*b ,a*2+b*2

Fixed submission:
h,w=map(int,raw_input().split())
print("%d %d"%(h*w,h*2+w*2))

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
print a*b ,a*2+b*2

Fixed submission:
h,w=map(int,raw_input().split())
print("%d %d"%(h*w,h*2+w*2))

Buggy python submission (verdict: Runtime Error):
h,w=map(int,raw_input().split())
print("%d %d"%(h*w,h*2+w*2))

Fixed submission:
h,w=map(int,raw_input().split())
print("%d %d"%(h*w,h*2+w*2))
Buggy python submission (verdict: Runtime Error):
a=input()
h=a/3600
m=(a-(h*3600))/60
s=a-(h*3600)-(m*60)
print '%d:%d:%d' %(h,m,s)

Fixed submission:
a=int(input())
h=int(a/3600)
m=int((a-(h*3600))/60)
s=int(a-(h*3600)-(m*60))
print("%d:%d:%d"%(h,m,s))
Buggy python submission (verdict: Runtime Error):
# O(NlgN) time

# build lower hull and upper hull in clockwise, concatenate them get convex hull

def convexHull(points):
  assert len(points) > 0

  points = sorted(set(points))

  # build lower hull
  lower = []
  for p in points:
    # cross(o, a, b) <= 0 not clockwise
    while len(lower) >= 2 and cross(lower[-2], lower[-1], p) <= 0:
      lower.pop()
    lower.append(p)
  
  # build upper hull
  upper = []
  for p in points[::-1]:
    while len(upper) >= 2 and cross(upper[-2], upper[-1], p) <= 0:
      upper.pop()
    upper.append(p)

  # concatenation of the lower and upper hulls gives the convex hull
  return lower[:-1] + upper[:-1]



# cross product of OA and OB vectors
# U(ou) = u1x + u2y,        V(ov) = v1x + v2y
# UxV = det |u1 u2| = (u1*v2) - (v1*u2) = (u[0]-o[0])*(v[1]-o[1]) - (u[1]-o[1])*(v[0]-o[0])
#           |v1 v2|
def cross(O, A, B):
  return (A[0] - O[0]) * (B[1] - O[1]) - (A[1] - O[1]) * (B[0] - O[0])

# assert convexHull([(i//10, i%10) for i in range(100)]) == [(0, 0), (9, 0), (9, 9), (0, 9)]



if __name__ == '__main__':
    _input = sys.stdin.readlines()
    points = int(_input[0])
    p_info = map(lambda x: x.split(), _input[1:])
    polygon = [(int(x), int(y)) for x, y in p_info]
    ans = convexHull(polygon)
    print(len(ans))
    for x, y in ans:
      print(x, y)


Fixed submission:
from functools import reduce
 
 
def cross(a, b):
    return a.real * b.imag - a.imag * b.real
 
 
def graham_scan(points):
    points.sort(key=lambda p: (p.real, p.imag))
    lh = reduce(keep_left, points, [])
    uh = reduce(keep_left, reversed(points), [])
    lh.extend(uh[1:-1])
    return lh
 
 
def keep_left(hull, r):
    if hull:
        prev = hull.pop()
        while hull:
            p = hull[-1]
            if cross(prev - p, r - p) >= 0:
                hull.append(prev)
                break
            prev = hull.pop()
        else:
            hull.append(prev)
    if not hull or hull[-1] != r:
        hull.append(r)
    return hull
 
 
n = int(input())
points = [complex(*map(int, input().split())) for _ in range(n)]
result = graham_scan(points)
lr = len(result)
print(lr)
s = min(range(lr), key=lambda i: (result[i].imag, result[i].real))
for p in (result[s:] + result[:s]):
    print(int(p.real), int(p.imag))
Buggy python submission (verdict: Runtime Error):
def coin(a, b, c):

    global count
    global m

    if a % c[0] == 0:

        count = min(count, b + a // c[0])

        return count

    elif b + a // c[0] >= count:

        return n

    elif c[0] < n:

        return min(cs(a - c[0], b + 1, c), cs(a, b, c[1:]))

    else:

        return coin(a, b, c[1:])


n, m = map(int, input().split())

money = sorted(list(map(int, input().split())), reverse = True)

count = print(coin(n, 0, money))


Fixed submission:
def coin(n, p, c):
    global count
    global m
    if n % c[0] == 0:
        count = min(count, p + n // c[0])
        return count
    elif p + n // c[0] >= count:
        return n
    elif c[0] < n:
        return min(coin(n - c[0], p + 1, c), coin(n, p, c[1:]))
    else:
        return coin(n, p, c[1:])

n, m = map(int, input().split())

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

mon.sort(reverse = True)

count = n

print(coin(n, 0, mon))

Buggy python submission (verdict: Runtime Error):
def coin(a, b, c):

    global count
    global m

    if a % c[0] == 0:

        count = min(count, b + a // c[0])

        return count

    elif b + a // c[0] >= count:

        return n

    elif c[0] < n:

        return min(coin(a - c[0], b + 1, c), cs(a, b, c[1:]))

    else:

        return coin(a, b, c[1:])


n, m = map(int, input().split())

money = sorted(list(map(int, input().split())), reverse = True)

count = print(coin(n, 0, money))


Fixed submission:
def coin(n, p, c):
    global count
    global m
    if n % c[0] == 0:
        count = min(count, p + n // c[0])
        return count
    elif p + n // c[0] >= count:
        return n
    elif c[0] < n:
        return min(coin(n - c[0], p + 1, c), coin(n, p, c[1:]))
    else:
        return coin(n, p, c[1:])

n, m = map(int, input().split())

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

mon.sort(reverse = True)

count = n

print(coin(n, 0, mon))

Buggy python submission (verdict: Runtime Error):
def coin(a, b, c):

    global count
    global m

    if a % c[0] == 0:

        count = min(count, b + a // c[0])

        return count

    elif b + a // c[0] >= count:

        return n

    elif c[0] < n:

        return min(coin(a - c[0], b + 1, c), coin(a, b, c[1:]))

    else:

        return coin(a, b, c[1:])


n, m = map(int, input().split())

money = sorted(list(map(int, input().split())), reverse = True)

count = n

print(coin(n, 0, money))



Fixed submission:
def coin(n, p, c):
    global count
    global m
    if n % c[0] == 0:
        count = min(count, p + n // c[0])
        return count
    elif p + n // c[0] >= count:
        return n
    elif c[0] < n:
        return min(coin(n - c[0], p + 1, c), coin(n, p, c[1:]))
    else:
        return coin(n, p, c[1:])

n, m = map(int, input().split())

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

mon.sort(reverse = True)

count = n

print(coin(n, 0, mon))
Buggy python submission (verdict: Time Limit Exceeded):
import math
n, m = map(int,input().split(' '))
d = list(map(int,input().split(' ')))
d.sort()
inf = n

dp = [ [ inf for i in range(m+1)] for j in range(n+1) ]

# dp
for j in range(m+1):
    dp[0][j]=0

for j in range(m-1,-1,-1):
    for i in range(n+1):
        for k in range(math.floor(i/d[j])+1 ):
            r = (k)*d[j]
            #print(i,j,k)
            dp[i][j] = min( dp[i][j], min( dp[i][j+1], dp[i-r][j]+k) )

print(dp[n][0])



Fixed submission:
import math
n, m = map(int,input().split(' '))
d = list(map(int,input().split(' ')))
d.sort()
inf = n

dp = [ [ inf for i in range(m+1)] for j in range(n+1) ]

# dp
for j in range(m+1):
    dp[0][j]=0

for j in range(m-1,-1,-1):
    for i in range(n+1):
        #for k in range(math.floor(i/d[j])+1):
        if math.floor(i/d[j]) >=1:
            k=1
        else:
            k=0
        r = k*d[j]
        #print(i,j,k)
        dp[i][j] = min( dp[i][j], dp[i][j+1], dp[i-r][j]+k ) 
        #print("dp:",i,j,dp[i][j])
print(dp[n][0])

Buggy python submission (verdict: Runtime Error):
import math
n, m = map(int,input().split(' '))
d = list(map(int,input().split(' ')))
d.sort()
inf = n

dp = [ [ inf for i in range(m+1)] for j in range(n+1) ]

# dp
for j in range(m+1):
    dp[0][j]=0

for j in range(m-1,-1,-1):
    for i in range(n+1):
        #for k in range(math.floor(i/d[j])+1):
        k=1
        r = k*d[j]
        #print(i,j,k)
        dp[i][j] = min( dp[i][j], dp[i][j+1], dp[i-r][j]+k ) 
        #print("dp:",i,j,dp[i][j])
print(dp[n][0])



Fixed submission:
import math
n, m = map(int,input().split(' '))
d = list(map(int,input().split(' ')))
d.sort()
inf = n

dp = [ [ inf for i in range(m+1)] for j in range(n+1) ]

# dp
for j in range(m+1):
    dp[0][j]=0

for j in range(m-1,-1,-1):
    for i in range(n+1):
        #for k in range(math.floor(i/d[j])+1):
        if math.floor(i/d[j]) >=1:
            k=1
        else:
            k=0
        r = k*d[j]
        #print(i,j,k)
        dp[i][j] = min( dp[i][j], dp[i][j+1], dp[i-r][j]+k ) 
        #print("dp:",i,j,dp[i][j])
print(dp[n][0])
Buggy python submission (verdict: Runtime Error):
N,W = map(int,input().split())
val = []
wei = []
for i in range(N):
    a,b = map(int,input().split())
    val.append(a)
    wei.append(b)

import numpy as np
#DPテーブル
dp = np.zeros((N+1,W+1))

#初期化
for j in range(W+1):
    dp[0][j] = 0

#DP計算
for i in range(N):
    for w in range(W+1):
        if(w >= wei[i]):
            dp[i+1][w] = max(dp[i][w - wei[i]] + val[i],dp[i][w])
        else:
            dp[i+1][w] = dp[i][w]

print(int(dp[N][W]))


Fixed submission:
N,W = map(int,input().split())
val = []
wei = []
for i in range(N):
    a,b = map(int,input().split())
    val.append(a)
    wei.append(b)

dp = [[0 for j in range(W+1)] for i in range(N+1)]

#DP計算
for i in range(N):
    for w in range(W+1):
        if(w >= wei[i]):
            dp[i+1][w] = max(dp[i][w - wei[i]] + val[i],dp[i][w])
        else:
            dp[i+1][w] = dp[i][w]

print(int(dp[N][W]))
Buggy python submission (verdict: Runtime Error):
x=input()
y=int(x)
print(x**3)


Fixed submission:
x=input()
y=int(x)
print(y**3)
Buggy python submission (verdict: Time Limit Exceeded):
maxd = 5000000001
nv, ne, r = [int(n) for n in input().split(' ')]
vertices = {k: {} for k in range(nv)}
for i in range(ne):
    s, t, w = [int(n) for n in input().split(' ')]
    vertices[s][t] = w

q = {v for v in vertices}
dist = {v: maxd for v in vertices}
dist[r] = 0

while len(q):
    min = maxd
    u = nv
    for v in q:
        if dist[v] <= min:
            min = dist[v]
            u = v

    q.remove(u)
    for v in vertices[u]:
        alt = dist[u] + vertices[u][v]
        if alt < dist[v]:
            dist[v] = alt

[print(d) if d < maxd else print("INF") for v, d in dist.items()]

Fixed submission:
import heapq

nv, ne, r = map(int, input().split(' '))
vertices = [[] for i in range(nv)]
for i in range(ne):
    s, t, w = map(int, input().split(' '))
    vertices[s].append((t, w))

q = []
heapq.heappush(q, (0, r))

dist = [float('inf')] * nv
dist[r] = 0

while len(q):
    u = heapq.heappop(q)[1]

    for t, w in vertices[u]:
        alt = dist[u] + w
        if alt < dist[t]:
            dist[t] = alt
            heapq.heappush(q, (alt, t))

[print(d) if d < float('inf') else print("INF") for d in dist]
Buggy python submission (verdict: Time Limit Exceeded):
nv, ne = map(int, input().split(' '))
edges = []
for i in range(ne):
    s, t, w = map(int, input().split(' '))
    edges.append((s, t, w))

for r in range(nv):
    dist = [float('inf')] * nv
    dist[r] = 0

    for i in range(nv - 1):
        for s, t, w in edges:
            if dist[t] > dist[s] + w:
                dist[t] = dist[s] + w

    for s, t, w in edges:
        if dist[t] > dist[s] + w:
            print("NEGATIVE CYCLE")
            exit()

    print(' '.join([str(d) if d < float('inf') else "INF" for d in dist]))

Fixed submission:
nv, ne = map(int, input().split(' '))
edges = []
for i in range(ne):
    s, t, w = map(int, input().split(' '))
    edges.append((s, t, w))

dist = [[float('inf')] * nv for i in range(nv)]
for i in range(nv):
    dist[i][i] = 0
for s, t, w in edges:
    dist[s][t] = w

for k in range(nv):
    for i in range(nv):
        for j in range(nv):
            if dist[i][j] > dist[i][k] + dist[k][j]:
                dist[i][j] = dist[i][k] + dist[k][j]

for i in range(nv):
    if dist[i][i] < 0:
        print("NEGATIVE CYCLE")
        exit()

for row in dist:
    print(' '.join(str(d) if d < float('inf') else 'INF' for d in row))
Buggy python submission (verdict: Time Limit Exceeded):
def find_tree(v):
    for tree in forest:
        if v in tree:
            return tree

nv, ne = map(int, input().split(' '))
edges = []
for i in range(ne):
    s, t, w = map(int, input().split(' '))
    edges.append((s, t, w))

sum = 0
forest = [[v] for v in range(nv)]
edges.sort(key=lambda tup: tup[2])
for s, t, w in edges:
    u = find_tree(s)
    v = find_tree(t)
    if u != v:
        [u.append(i) for i in v]
        forest.remove(v)
        sum += w
    if len(forest) == 1:
        break

print(sum)
exit()

Fixed submission:
def find(x):
    if parents[x] != x:
        parents[x] = find(parents[x])
    return parents[x]

nv, ne = map(int, input().split(' '))
parents = [i for i in range(nv)]
edges = []
for i in range(ne):
    s, t, w = map(int, input().split(' '))
    edges.append((s, t, w))

sum = 0
edges.sort(key=lambda tup: tup[2])
for s, t, w in edges:
    u = find(s)
    v = find(t)
    if u != v:
        parents[u] = v
        sum += w

print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
def dfs(s, stack):
    visited[s] = 1
    if s in stack:
        print(1)
        exit()
    else:
        stack.append(s)
        for t in adj[s]:
            dfs(t, stack)
        stack.remove(s)

nv, ne = map(int, input().split(' '))
adj = [[] for _ in range(nv)]
visited = [0] * nv

for _ in range(ne):
    s, t = map(int, input().split(' '))
    adj[s].append(t)

while sum(visited) < nv:
    r = 0
    while visited[r]: r += 1
    dfs(r, [])

print(0)

Fixed submission:
def dfs(s):
    if not visited[s]:
        visited[s] = True
        stack[s] = True
        for t in adj[s]:
            if stack[t]:
                print(1)
                exit()
            else:
                dfs(t)
    stack[s] = False

nv, ne = map(int, input().split(' '))
adj = [[] for _ in range(nv)]
visited = [False] * nv
stack = [False] * nv

for _ in range(ne):
    s, t = map(int, input().split(' '))
    adj[s].append(t)

for i in range(nv):
    dfs(i)

print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import queue

nv, ne = map(int, input().split(' '))
in_degrees = [[] for _ in range(nv)]
q = queue.Queue()
o = []

for _ in range(ne):
    s, t = map(int, input().split(' '))
    in_degrees[t].append(s)

for i in range(nv):
    if len(in_degrees[i]) == 0: q.put(i)

while not q.empty():
    v = q.get()
    o.append(v)

    for i in range(nv):
        if v in in_degrees[i]:
            in_degrees[i].remove(v)
            if len(in_degrees[i]) == 0: q.put(i)

[print(v) for v in o]

Fixed submission:
nv, ne = map(int, input().split(' '))
in_degs = [0] * nv
q = []
outs = {}
o = []

for _ in range(ne):
    s, t = map(int, input().split(' '))

    if s in outs: outs[s].append(t)
    else: outs[s] = [t]

    in_degs[t] += 1

for i in range(nv):
    if in_degs[i] == 0: q.append(i)

while q:
    v = q.pop(0)
    o.append(v)

    if v in outs:
        for out in outs[v]:
            in_degs[out] -= 1
            if in_degs[out] == 0: q.append(out)

[print(v) for v in o]
Buggy python submission (verdict: Runtime Error):
a, b = input().split()
print(a * b, 2 * (a + b))

Fixed submission:
a, b = map(int, input().split())
print(a * b, 2 * (a + b))
Buggy python submission (verdict: Runtime Error):
import sys
for i, x in map(int, sys.stdin):
    if not x: break
    print("Case {0}: {1}".format(i, x))

Fixed submission:
import sys
for i, x in enumerate(map(int, sys.stdin)):
    if not x: break
    print("Case {0}: {1}".format(i + 1, x))
Buggy python submission (verdict: Runtime Error):
r = int(input())
print(r * r * 3.14159, 2 * r * 3.14159)

Fixed submission:
a, b = map(int, input().split())
print(a //b , a % b, "{0:.5f}".format(a / b))
Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(r * r * math.pi, 2 * r * math.pi)

Fixed submission:
import math
r = float(input())
print(r * r * math.pi, 2 * r * math.pi)

Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(r * r * math.pi, 2 * r * math.pi)

Fixed submission:
import math
r = float(input())
print(r * r * math.pi, 2 * r * math.pi)

Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(r * r * math.pi, 2 * r * math.pi)

Fixed submission:
import math
r = float(input())
print(r * r * math.pi, 2 * r * math.pi)

Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(3.14, 3.14)

Fixed submission:
import math
r = float(input())
print(r * r * math.pi, 2 * r * math.pi)

Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(22, 222)

Fixed submission:
import math
r = float(input())
print(r * r * math.pi, 2 * r * math.pi)

Buggy python submission (verdict: Runtime Error):
r = int(input())
print(2, 2)

Fixed submission:
import math
r = float(input())
print(r * r * math.pi, 2 * r * math.pi)
Buggy python submission (verdict: Runtime Error):
S = int(input())

h = S // 3600
m = S % 3600 // 60
s = S % 60

print(h, m, s, cep=':')

Fixed submission:
S = int(input())
h = S // 3600
m = S % 3600 // 60
s = S % 60
print(h, m, s, sep=':')