Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b,c=map(float,input().split())
from math import sqrt
def fl(x):
    digits = 9
    form = '%.'+str(digits-1)+'e'
    return float((form % x))
def int_sqrt2(n):
    def f(prev):
        while True:
            m = (prev + n / prev) / 2
            if m >= prev:
                return prev
            prev = m
    
    return f(int(sqrt(n) * (1 + 1e-10)))
if float(fl(a)*fl(b))<int_sqrt2(float(fl(fl(c-a)-b))/float(4)):
    print("Yes")
else:
    print("No")


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

if c-a-b <= 0:
    print("No")
elif 4*a*b < (c-a-b)**2:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c=map(float,input().split())
from math import sqrt
def fl(x):
    digits = 9
    form = '%.'+str(digits-1)+'e'
    return float((form % x))
def int_sqrt2(n):
    def f(prev):
        while True:
            m = (prev + n / prev) / 2
            if m >= prev:
                return prev
            prev = m
    
    return f(int(sqrt(n) * (1 + 1e-10)))
if float(fl(a)*fl(b))<int_sqrt2(float(fl(fl(c-a)-b))/float(2)):
    print("Yes")
else:
    print("No")


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

if c-a-b <= 0:
    print("No")
elif 4*a*b < (c-a-b)**2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int,input().split())
aa=n//(a+b)
ss=n%(a+b)
ans=0
for i in range(aa):
    ans+=a
if ss>a:
    ans+=a
else:
    ans+=ss

print(ans)

Fixed submission:
n,a,b=map(int,input().split())
aa=n//(a+b)
ss=n%(a+b)
ans=0
ans=ans+aa*a
if ss>a:
    ans+=a
else:
    ans+=ss

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

s=input()
q=int(input())
cnt=0
qq=[tuple(input().split()) for _ in [0]*q]
for j in qq:
    if  len(j)!=1 :
        if (cnt+int(j[1]))%2==1:
            s=j[2]+s
        else:
            s=s+j[2]
    else:
        cnt+=1
if cnt%2==0:
    print(s)
else:
    print(s[::-1])

Fixed submission:
a,b=map(int,input().split())
import math 
ans=0
for i in range(1,1001):
    aa=math.floor(i*0.08)
    bb=math.floor(i*0.1)
    if aa==a and bb==b:
        print(i)
        break
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
ans=[0]*n

for _ in range(m):
  s,c=map(int,input().split())
  ans[s-1]=c
if n>1 and ans[0]==0:
  print(-1)
  exit()
elif n==1 ans[0]==0:
  print(0)
  exit()
else:
  for i in ans:
    print(i,end="")


Fixed submission:
SC=[]
n,m=map(int,input().split())
if n==1:
      r=range(0,10)
elif n==2:
      r=range(10,100)
else:
      r=range(100,1000)
for _ in range(m):
  s,c=map(int,input().split())
  s-=1
  SC.append((s,c))
for i in r:
      i=str(i)
      for s,c in SC:
            if i[s]!=str(c):
                break
      else:
            print(int(i))
            exit()

print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 10**18:
    ans = -1
print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 1
for i in range(n):
    ans *= a[i]
    if ans == 0:
        break
    if ans > 10**18:
        ans = -1
        break

print(ans)
Buggy python submission (verdict: Runtime Error):
def bfs_opt(s):
    signs[s] = 0
    Q.append(s)
    while len(Q) > 0:
        u = Q.popleft()
        for v in rooms[u]:
            if signs[v] == INFTY:
                signs[v] = u
                Q.append(v)


n, m = map(int, input().split())
rooms = [[] for i in range(n)]

# adjacent list
for i in range(m):
    a, b = map(int, input().split())
    rooms[a-1].append(b-1)
    rooms[b-1].append(a-1)

INFTY = float('inf')
signs = [INFTY] * n

# status を保持しなくても、signs == INFTY (== 未訪問) で訪問済みかどうかの判定は可能
# for bfs()
# NOT_VISITED = 0
# VISITING = 1
# VISITED = 2
# status = [NOT_VISITED] * n

Q = deque()

bfs_opt(0)

# ok = True
# for sign in signs:
#     if sign == INFTY:
#         ok = False

# ok にならない (No になる) ケースは存在しない
print('Yes')
signs = signs[1:]
for sign in signs:
    print(sign + 1)

Fixed submission:
from collections import deque

def bfs(s):
    status[s] = VISITING
    signs[s] = 0
    Q.append(s)
    while len(Q) > 0:
        u = Q.popleft()
        for v in rooms[u]:
            if status[v] == NOT_VISITED:
                status[v] = VISITING
                signs[v] = u
                Q.append(v)
        status[u] = VISITED


n, m = map(int, input().split())
rooms = [[] for i in range(n)]

for i in range(m):
    a, b = map(int, input().split())
    rooms[a-1].append(b-1)
    rooms[b-1].append(a-1)

INFTY = float('inf')
signs = [INFTY] * n

NOT_VISITED = 0
VISITING = 1
VISITED = 2
status = [NOT_VISITED] * n
Q = deque()

bfs(0)
ok = True

for sign in signs:
    if sign == INFTY:
        ok = False

if ok:
    print('Yes')
    signs = signs[1:]
    for sign in signs:
        print(sign + 1)
Buggy python submission (verdict: Runtime Error):
import sys
# sys.stdin = open('input.txt')

n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(len(a)):
    a[i] -= 1

cycle = n + 1
# sub = []
place = 0

for i in range(len(a)):
    place = a[i]
    # sub.append(a[i])
    if place == 0:
        # sub = sub[:-1]
        cycle = i
        break

# print(cycle, sub)
# ans = sub[k%cycle] + 1
ans = 0
for i in range(k%cycle+1):
    ans = a[i] + 1
print(ans)

Fixed submission:
import sys
# sys.stdin = open('input.txt')

n, k = map(int, input().split())
a = list(map(int, input().split()))

s = []  #　頂点を訪れた順番に持つ数列
ord = [-1 for i in range(n+1)]  # 訪問済みの頂点の index. 未訪問のときは -1
c = 1  # 周期
l = 0  # 例外部分の長さ

v = 1  # 現在の頂点
while ord[v] == -1:
    ord[v] = len(s)
    s.append(v)
    v = a[v-1]

l = ord[v]
c = len(s) - l

if k < l:
    print(s[k])
else:
    k -= l
    k %= c
    print(s[l+k])

Buggy python submission (verdict: Runtime Error):
import sys
# sys.stdin = open('input.txt')

n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(len(a)):
    a[i] -= 1

cycle = n + 1
sub = []
place = 0

for i in range(len(a)):
    place = a[i]
    sub.append(a[i])
    if place == 0:
        sub = sub[:-1]
        cycle = i
        break

# print(cycle, sub)
ans = sub[k%cycle] + 1
print(ans)

Fixed submission:
import sys
# sys.stdin = open('input.txt')

n, k = map(int, input().split())
a = list(map(int, input().split()))

s = []  #　頂点を訪れた順番に持つ数列
ord = [-1 for i in range(n+1)]  # 訪問済みの頂点の index. 未訪問のときは -1
c = 1  # 周期
l = 0  # 例外部分の長さ

v = 1  # 現在の頂点
while ord[v] == -1:
    ord[v] = len(s)
    s.append(v)
    v = a[v-1]

l = ord[v]
c = len(s) - l

if k < l:
    print(s[k])
else:
    k -= l
    k %= c
    print(s[l+k])
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
h = list(map(int, input().split()))

edges = [[0 for _ in range(n)] for _ in range(n)]

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a][b] = 1
    edges[b][a] = 1

ans = 0

for own in range(n):
    is_good = True
    for pair in range(n):
        if edges[own][pair] == 1:
            if h[own] <= h[pair]:
                is_good= False
    if is_good:
        ans += 1

print(ans)

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

edges = [[] for _ in range(n)]

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)

ans = 0

for own in range(n):
    is_good = True
    for pair in edges[own]:
        if h[own] <= h[pair]:
            is_good= False
    if is_good:
        ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(n):
    for j in range(i+1, n):
        if abs(j-i) == a[i]+a[j]:
            ans += 1
print(ans)

Fixed submission:
import sys
# sys.stdin = open('input.txt')

# i < j
# j - i == Ai + Aj
# j - Aj == i + Ai

n = int(input())
a = list(map(int, input().split()))

ans = 0
# key: i + Ai, value: count
d = {}

for j in range(n):
    a1 = j - a[j]
    try:
        ans += d[a1]
    except KeyError:
        d[a1] = 0

    a2 = j + a[j]
    try:
        d[a2] += 1
    except KeyError:
        d[a2] = 1

print(ans)
Buggy python submission (verdict: Runtime Error):
# https://www.youtube.com/watch?v=C5_NnCp1CRI&feature=youtu.be

import sys
sys.stdin = open('input.txt')
import itertools

# C++
# https://atcoder.jp/contests/abc165/submissions/12656990
# Python
# https://atcoder.jp/contests/abc165/submissions/12832942
# https://atcoder.jp/contests/abc165/submissions/12832027
def dfs(A):
    """
    dfs([1]) で使用。index 1 からが本来求めたい数列になる
    """
    global ans
    if len(A) == n+1:
        # print(A)
        now = 0
        for j in range(q):
            if A[b[j]] - A[a[j]] == c[j]:
                now += d[j]
        ans = max(ans, now)
        return
    else:
        # 以下 2 行いずれの場合も、既存リストが mutate されるのでうまく再帰できない
        # A.append(A[-1])
        # A += [A[-1]]
        # 以下は変数の再定義なのでリストは mutate されない
        A = A + [A[-1]]
        # こちらも mutate しない例
        # A = A[:]
        # A.append(A[-1])
        while A[-1] <= m:
            # print(A)
            dfs(A)
            A[-1] += 1

# https://atcoder.jp/contests/abc165/submissions/12679398
# AC
def dfs2(i):
    global ans
    for j in range(num[i-1], m):
        num[i] = j
        if i == n:
            print(num)
            now = 0
            for k in range(q):
                if num[b[k]] - num[a[k]] == c[k]:
                    now += d[k]
            ans = max(ans, now)
        else:
            dfs2(i+1)

def solve_combinations_with_replacement(n, m):
    def update_ans(A):
        global ans
        now = 0
        for j in range(q):
            if A[b[j]-1] - A[a[j]-1] == c[j]:
                now += d[j]
        ans = max(ans, now)
        return

    global ans
    it = [i for i in range(m)]
    for A in itertools.combinations_with_replacement(it, n):
        update_ans(A)


n, m, q = map(int, input().split())
a, b, c, d = [], [], [], []
ans = 0

for i in range(q):
    ai, bi, ci, di = map(int, input().split())
    a.append(ai)
    b.append(bi)
    c.append(ci)
    d.append(di)

dfs([1])

# num = [0] * (n+1)
# dfs2(1)

# solve_combinations_with_replacement(n, m)

print(ans)

Fixed submission:
def dfs2(i):
    global ans
    for j in range(num[i-1], m):
        num[i] = j
        if i == n:
            now = 0
            for k in range(q):
                if num[b[k]] - num[a[k]] == c[k]:
                    now += d[k]
            ans = max(ans, now)
        else:
            dfs2(i+1)


n, m, q = map(int, input().split())
a, b, c, d = [], [], [], []
ans = 0

for i in range(q):
    ai, bi, ci, di = map(int, input().split())
    a.append(ai)
    b.append(bi)
    c.append(ci)
    d.append(di)

num = [0] * (n+1)

# dfs([1])
dfs2(1)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
# sys.stdin = open('input.txt')

n = int(input())
a = list(map(int, input().split()))

ans = {}
for i in range(1, n+1):
    ans[i] = a.count(i)

for i in ans.values():
    print(i)

Fixed submission:
import sys
# sys.stdin = open('input.txt')

n = int(input())
a = list(map(int, input().split()))

ans = {}
for i in range(1, n+1):
    ans[i] = 0
for i in a:
    ans[i] += 1

for i in ans.values():
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
# sys.stdin = open('input.txt')

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

a = [i for i in range(n+1)]
a_rev = sorted(a, reverse=True)

ans = 0
for i in range(k, n+2):
    first = 0
    last = 0
    for j in range(i):
        first += a[j]
        last += a_rev[j]
    ans += last - first + 1

print(ans)

Fixed submission:
import sys
# sys.stdin = open('input.txt')

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

MOD = 10**9 + 7
a = [i for i in range(n+1)]

ans = 0
for i in range(k, n+2):
    first = i * (a[0] + a[i-1]) / 2
    last = i * (a[-i] + a[-1]) / 2
    ans += last - first + 1
print(int(ans%MOD))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
# sys.stdin = open('input.txt')

from math import gcd


def triple_gcd(x, y, z):
    return gcd(gcd(x, y), z)


k = int(input())
ans = 0
for i in range(1, k+1):
    for j in range(1, k+1):
        for k in range(1, k+1):
            ans += triple_gcd(i, j, k)

print(ans)

Fixed submission:
import sys
# sys.stdin = open('input.txt')

from math import gcd


k = int(input())
ans = 0
memory = {}

for i in range(1, k+1):
    for j in range(1, k+1):
        temp = gcd(i, j)
        for k in range(1, k+1):
            ans += gcd(temp, k)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import time
# start = time.time()
import sys
# sys.stdin = open('input.txt')

from math import gcd


n = int(input())
s = input()
i_indices = []
j_indices = []
k_indices = []

for i in range(n):
    if s[i] == 'R':
        i_indices.append(i+1)
    elif s[i] == 'G':
        j_indices.append(i+1)
    else:
        k_indices.append(i+1)

# print(i_indices, len(i_indices))
# print(j_indices, len(j_indices))
# print(k_indices, len(k_indices))

ans = 0

for i in i_indices:
    for j in j_indices:
        for k in k_indices:
            tmp  = [i, j, k]
            tmp.sort()
            if tmp[1] - tmp[0] != tmp[2] - tmp[1]:
                ans += 1
print(ans)
# end = time.time()
# print(end - start)

Fixed submission:
import time
start = time.time()
import sys
# sys.stdin = open('input.txt')

n = int(input())
s = input()
# r = []
# g = []
# b = []
#
# for i in range(n):
#     if s[i] == 'R':
#         r.append(i)
#     elif s[i] == 'G':
#         g.append(i)
#     else:
#         b.append(i)


ans = s.count('R') * s.count('G') * s.count('B')
# print(ans)

for j in range(n):
    for i in range(j):
        k = 2 * j - i
        if k < n:
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
                ans -= 1

print(ans)
# end = time.time()
# print(end - start)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
# sys.stdin = open('input.txt')

from math import gcd


n = int(input())
s = input()
i_indices = []
j_indices = []
k_indices = []

for i in range(n):
    if s[i] == 'R':
        i_indices.append(i+1)
    elif s[i] == 'G':
        j_indices.append(i+1)
    else:
        k_indices.append(i+1)

# print(i_indices, len(i_indices))
# print(j_indices, len(j_indices))
# print(k_indices, len(k_indices))

ans = 0

for i in i_indices:
    for j in j_indices:
        for k in k_indices:
            a, b, c = i, j, k
            if b - a != c - b and a < b < c:
                ans += 1
            a, b, c = i, k, j
            if b - a != c - b and a < b < c:
                ans += 1
            a, b, c = j, i, k
            if b - a != c - b and a < b < c:
                ans += 1
            a, b, c = j, k, i
            if b - a != c - b and a < b < c:
                ans += 1
            a, b, c = k, i, j
            if b - a != c - b and a < b < c:
                ans += 1
            a, b, c = k, j, i
            if b - a != c - b and a < b < c:
                ans += 1

print(ans)

Fixed submission:
import time
start = time.time()
import sys
# sys.stdin = open('input.txt')

n = int(input())
s = input()
# r = []
# g = []
# b = []
#
# for i in range(n):
#     if s[i] == 'R':
#         r.append(i)
#     elif s[i] == 'G':
#         g.append(i)
#     else:
#         b.append(i)


ans = s.count('R') * s.count('G') * s.count('B')
# print(ans)

for j in range(n):
    for i in range(j):
        k = 2 * j - i
        if k < n:
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
                ans -= 1

print(ans)
# end = time.time()
# print(end - start)
Buggy python submission (verdict: Runtime Error):
import sys
# sys.stdin = open('input.txt')

import math

n,m = map(int, input().split())
def c(n):
    return int(math.factorial(n) / math.factorial(n-2) / math.factorial(2))

if n == 1 and m == 1:
    print(0)
else:
    print(c(n)+c(m))

Fixed submission:
import sys
# sys.stdin = open('input.txt')

import math

n,m = map(int, input().split())
def c(n):
    return int(math.factorial(n) / math.factorial(n-2) / math.factorial(2))

if n == 1 and m == 1:
    print(0)
elif n <= 1:
    print(c(m))
elif m <= 1:
    print(c(n))
else:
    print(c(n)+c(m))
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int, input().split())

s = []
flag = True
cnt = 0
while True:
    for i in range(a):
        if cnt > n:
            break
        s.append('b')
        cnt += 1
    for i in range(b):
        if cnt > n:
            break
        s.append('r')
        cnt += 1
    if cnt > n:
        break
print(s[:n].count('b'))

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

ans = 0
ans += n // (a + b) * a
rem = n % (a + b)
if a == 0:
    pass
elif rem > a:
    ans += a
elif rem <= a:
    ans += rem
print(ans)

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

s = ''
for i in range(10**100):
    s += 'b' * a
    s += 'r' * b
    if len(s) > n:
        break
print(s[:n].count('b'))

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

ans = 0
ans += n // (a + b) * a
rem = n % (a + b)
if a == 0:
    pass
elif rem > a:
    ans += a
elif rem <= a:
    ans += rem
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in s:
  if s[i] == s[k-1]:
    s[i] = '*'
    print(s[i], end = '')

Fixed submission:
n = int(input())
s = input()
k = int(input())
for i in s:
  if i == s[k-1]:
    print(i, end = '')
  else:
    print('*', end = '')

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in range(n):
  if s[i] == s[k]:
    s[i] = '*'
    print(s[i], end = '')

Fixed submission:
n = int(input())
s = input()
k = int(input())
for i in s:
  if i == s[k-1]:
    print(i, end = '')
  else:
    print('*', end = '')

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in range(n):
  if s[i] == s[k]:
    s[i] = '*'
   

Fixed submission:
n = int(input())
s = input()
k = int(input())
for i in s:
  if i == s[k-1]:
    print(i, end = '')
  else:
    print('*', end = '')
Buggy python submission (verdict: Runtime Error):
n,T = map(int, input().split())
a = [int(input()) for i in range(n)]
m = 1001
for i in range(n):
    c,t = map(int, input().split())
    if t <= T and c < m:
        m = c
print(m)

Fixed submission:
n,T = map(int, input().split())
m = 1001
for i in range(n):
    c,t = map(int, input().split())
    if t <= T and c < m:
        m = c
if m == 1001:
    print('TLE')
else:
    print(m)
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans == 0
for i in range(1,10):
    count = 100*i + 10*i + i
    if n <= count:
        ans = count
    else: break

Fixed submission:
n = int(input())
ans = 0
for i in range(1,10):
    count = 100*i + 10*i + i
    if n <= count:
        ans = count
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
4
1 4 6 3

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))
Buggy python submission (verdict: Runtime Error):
x = int(input())
c = 1
for i in range(1,x):
    for j in range(2,x)
        if i**j <= x:
            c = max(c, i**j)
        else:break
print(c)

Fixed submission:
x = int(input())
c = 1
for i in range(1,x):
    for j in range(2,x):
        if i**j <= x:
            c = max(c, i**j)
        else:break
print(c)
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
list = []
for i in range(a, b+1):
    list.append(i)
ans = []
for i in range(k):
    print(list[i])
for i in range(k):
    print(list[-k+i])

Fixed submission:
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
list = []
for i in range(a, b+1):
    list.append(i)
revList = sorted(list, reverse=True)
ans = []
for i in range(k):
    print(list[i])
for i in range(k):
    print(list[-k+i])

Fixed submission:
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
print(x-t if x-t>=0 else 0)

Fixed submission:
x,t = map(int, input().split())
print(x-t if x-t>=0 else 0)
Buggy python submission (verdict: Runtime Error):
a,b,c=input()
if a == c: print('Yes') else: print('No')

Fixed submission:
a,b,c=input()
if a == c:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1
for i in range(1, n+1):
    ans *= i
print(ans%(10**9+7))

Fixed submission:
n = int(input())
ans = 1
for i in range(1, n+1):
    ans *= i
    ans = ans % (10**9+7)
print(ans)
Buggy python submission (verdict: Runtime Error):
stack = []
for s in input():
    if s == '0' or s == '1':
        stack.append(s)
    if s == 'B':
        stack.pop()
print(''.join(stack))

Fixed submission:
stack = []
for s in input():
    if s == '0' or s == '1':
        stack.append(s)
    elif s == 'B' and len(stack) != 0:
        stack.pop()
print(''.join(stack))

Buggy python submission (verdict: Runtime Error):
stack = []
for s in input()
    if s == '0' or s == '1':
        stack.append(s)
    if s == 'B':
        stack.pop()
print(''.join(stack))

Fixed submission:
stack = []
for s in input():
    if s == '0' or s == '1':
        stack.append(s)
    elif s == 'B' and len(stack) != 0:
        stack.pop()
print(''.join(stack))
Buggy python submission (verdict: Runtime Error):
n, l = map (int, input().split())
s = sorted([input() for i in ratnge(n)])
print(*s, sep='')

Fixed submission:
n, l = map (int, input().split())
s = sorted([input() for i in range(n)])
print(*s, sep='')

Buggy python submission (verdict: Runtime Error):
n, l = map (int, input().split())
s = sorted(input() for i in ratnge(n))
print(*s, sep='')

Fixed submission:
n, l = map (int, input().split())
s = sorted([input() for i in range(n)])
print(*s, sep='')
Buggy python submission (verdict: Runtime Error):
a,b = map(int, 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, b = map(int, 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: Time Limit Exceeded):
import itertools
import math
from functools import reduce

def gcd(*nums):
    return reduce(math.gcd, nums)

N = int(input())

l = list(range(1,N+1))
tap = list(itertools.product(l, repeat=3))
total = 0
for i in tap:
  total += gcd(i[0],i[1],i[2])
print(total)

Fixed submission:
import math
ans = 0
n = int(input())

for i in range(1,n+1):
    for j in range(1,n+1):
        l = math.gcd(i,j)
        for k in range(1,n+1):
            ans += math.gcd(k,l)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
  return reduce(math.gcd, numbers)

K = int(input())
total = 0

for a in range(1,K+1):
  for b in range(1,K+1):
    for c in range(1,K+1):
      total += gcd(a,b,c)
print(total)

Fixed submission:
import math
ans = 0
n = int(input())

for i in range(1,n+1):
    for j in range(1,n+1):
        l = math.gcd(i,j)
        for k in range(1,n+1):
            ans += math.gcd(k,l)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions
from functools import reduce

def gcd(*numbers):
  return reduce(fractions.gcd, numbers)

K = int(input())
total = 0

for a in range(1,K+1):
  for b in range(1,K+1):
    for c in range(1,K+1):
      total += gcd(a,b,c)
print(total)

Fixed submission:
import math
ans = 0
n = int(input())

for i in range(1,n+1):
    for j in range(1,n+1):
        l = math.gcd(i,j)
        for k in range(1,n+1):
            ans += math.gcd(k,l)
print(ans)