Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = input()

print(s[0] + len(s[1:-1]) + s[-1])


Fixed submission:
s = input()

print(s[0] + str(len(s[1:-1])) + s[-1])
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
N = int(input())
rates = [int(i) for i in input().split()]

color_nums = defaultdict(int)

for rate in rates:
    if rate <= 399:
        color_nums['灰'] += 1
    elif rate <= 799:
        color_nums['茶'] += 1
    elif rate <= 1199:
        color_nums['緑'] += 1
    elif rate <= 1599:
        color_nums['水'] += 1
    elif rate <= 1999:
        color_nums['青'] += 1
    elif rate <= 2399:
        color_nums['黄'] += 1
    elif rate <= 2799:
        color_nums['橙'] += 1
    elif rate <= 3199:
        color_nums['赤'] += 1
    else:
        color_nums['自由'] += 1

free_num = color_nums['自由']
if free_num == 0:
    # 自由に変えられる人がいない場合
    print(len(color_nums), len(color_nums))
elif free_num == N:
    # 自由に変えられる人しかいない場合
    print(min(N, 8), 1)
elif free_num != N:
    # 自由な人と混在
    tmp = dict(free_num)  # コピーを作る
    tmp.pop('自由')
    l_tmp = len(tmp)
    min_num = l_tmp
    max_num = l_tmp + free_num
    print(max_num, min_num)


Fixed submission:
from collections import defaultdict
N = int(input())
rates = [int(i) for i in input().split()]
# N = 4
# rates = [2100, 2500, 2700, 2700]

color_nums = defaultdict(int)

for rate in rates:
    if rate <= 399:
        color_nums['灰'] += 1
    elif rate <= 799:
        color_nums['茶'] += 1
    elif rate <= 1199:
        color_nums['緑'] += 1
    elif rate <= 1599:
        color_nums['水'] += 1
    elif rate <= 1999:
        color_nums['青'] += 1
    elif rate <= 2399:
        color_nums['黄'] += 1
    elif rate <= 2799:
        color_nums['橙'] += 1
    elif rate <= 3199:
        color_nums['赤'] += 1
    else:
        color_nums['自由'] += 1

free_num = color_nums['自由']
if free_num == 0:
    # 自由に変えられる人がいない場合
    # -1 は free_num = color_nums['自由']で増えてしまったので...
    print(len(color_nums)-1, len(color_nums)-1)
elif free_num == N:
    # 自由に変えられる人しかいない場合
    print(1, free_num)
elif free_num != N:
    # 自由な人と混在
    tmp = dict(color_nums)  # コピーを作る
    tmp.pop('自由')
    l_tmp = len(tmp)
    min_num = l_tmp
    max_num = l_tmp + free_num
    print(min_num, max_num)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
ABs = [input().split() for i in range(M)]
 
 
MPs = {}
for a, b in ABs:
	a = int(a)
    b = int(b)
    if a not in MPs:
        MPs[a] = 1
    else:
        MPs[a] += 1
    if b not in MPs:
        MPs[b] = 1
    else:
        MPs[b] += 1
 
for mp in range(1, N+1):
    if mp not in MPs:
        MPs[mp] = '0'
 
for _, y in sorted(MPs.items()):
    print(y)

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

for _ in range(M):
    a, b = map(int, input().split())
    city_road_nums[a] += 1
    city_road_nums[b] += 1

for i in range(1, N+1):
    print(city_road_nums[i])

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
ABs = [input().split() for i in range(M)]
 
 
MPs = {}
for a, b in ABs:
    a = int(a)
    b = int(b)
    if a not in MPs:
        MPs[a] = 1
    else:
        MPs[a] += 1
    if b not in MPs:
        MPs[b] = 1
    else:
        MPs[b] += 1
 
for mp in range(1, N+1):
    if mp not in MPs:
        MPs[mp] = '0'
 
for y in sorted(MPs.values()):
    print(y)

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

for _ in range(M):
    a, b = map(int, input().split())
    city_road_nums[a] += 1
    city_road_nums[b] += 1

for i in range(1, N+1):
    print(city_road_nums[i])

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
ABs = [input().split() for i in range(M)]
 
 
MPs = {}
for a, b in ABs:
	a = int(a)
    b = int(b)
    if a not in MPs:
        MPs[a] = 1
    else:
        MPs[a] += 1
    if b not in MPs:
        MPs[b] = 1
    else:
        MPs[b] += 1
 
for mp in range(1, N+1):
    if mp not in MPs:
        MPs[mp] = '0'
 
for y in sorted(MPs.values()):
    print(y)

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

for _ in range(M):
    a, b = map(int, input().split())
    city_road_nums[a] += 1
    city_road_nums[b] += 1

for i in range(1, N+1):
    print(city_road_nums[i])
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())

if A[-1] == B[0] and B[-1] == C[0]:
    print('YES')
else:
    print('NO')


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

if A[-1] == B[0] and B[-1] == C[0]:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
from collections import Counter


def prime_factorize(n):
    p = 2
    fct = []
    # 素数pはp**2がAを超えないもの
    while n >= p ** 2:
        if n % p == 0:
            # このpは、2乗がAを超えないもの
            # 2乗がnを超えない限り割り続ける: 各pの積で割る
            n //= p
            fct.append(p)
        p += 1
    if n > 1:
        fct.append(n)
    return fct


N = int(input())
MOD = 1000000007
numbers = [prime_factorize(i) for i in range(1, N+1)]

count_numbers = Counter(numbers)
ans = 1
for n in count_numbers.values():
    ans *= ((n+1) % MOD)

print(ans % MOD)


Fixed submission:
from collections import Counter


def prime_factorize(n):
    p = 2
    fct = []
    # 素数pはp**2がnを超えないもの（ただしnはある素数で割り切れるだけ割り切れたもの）
    # これはある素数p(i)でnを割れる時、他の素数p(i以外)はn//p(i) を割り切れるものになるため

    # 例えば、nが54なら
    # p が2のとき 54 // 2 で27
    # 27はもう2で割り切れないので2は1個
    # この時点でnは27に更新されている
    # 次にp が3の時、何度もpで割る（3度）
    while n >= p ** 2:
        while n % p == 0:
            n //= p
            fct.append(p)
        p += 1
    if n > 1:
        fct.append(n)
    return fct


N = int(input())
MOD = 1000000007
numbers = []
for i in range(1, N+1):
    numbers += prime_factorize(i)

count_numbers = Counter(numbers)
ans = 1
for n in count_numbers.values():
    ans *= ((n+1) % MOD)

print(ans % MOD)
Buggy python submission (verdict: Runtime Error):
s = input()
n = len(s) - 1

ans = 0
for i in range(2 ** n):
    tmp = ''
    for j in range(n):
        tmp += s[j]
        if i & 1 << j:
            tmp += '+'
    tmp += s[j+1]
    if '+' in tmp:
        ans += eval(tmp)
    else:
        ans += int(tmp)

print(ans)


Fixed submission:
s = input()
n = len(s) - 1

if n == 0:
    print(s)
else:
    ans = 0
    for i in range(2 ** n):
        tmp = ''
        for j in range(n):
            tmp += s[j]
            if i & 1 << j:
                tmp += '+'
        tmp += s[j+1]
        if '+' in tmp:
            ans += eval(tmp)
        else:
            ans += int(tmp)

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

def solve(T,X):
    return T/X

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    X = int(ws[1])
    return (T, X,)

def main():
    solve(*readQuestion())

# Uncomment before submission
 main()

Fixed submission:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(T,X):
    return T/X

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(a/b)


Fixed submission:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(T,X):
    return T/X

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()

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

def solve(T,X):
    return T/X
    pass


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    X = int(ws[1])
    return (T, X,)

def main():
    solve(*readQuestion())

# Uncomment before submission
 main()

Fixed submission:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(T,X):
    return T/X

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()

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

def solve(T,X):
    return T/X



def readQuestion():
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    X = int(ws[1])
    return (T, X,)

def main():
    solve(*readQuestion())

# Uncomment before submission
 main()

Fixed submission:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(T,X):
    return T/X

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(S):
    x = S
    if len(S) == 2:
        return S
    elif len(S) == 3 :
        return x[2] + x[1] + x[0]

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
    
if __name__ == '__main__':
    main()

Fixed submission:
s = input()

x = s
if len(s) == 2 :
    print (s)
elif len(s) == 3 :
    print (x[2] + x[1] + x[0])

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

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(S):
    x = S
    if len(S) == 2:
        return S
    elif len(S) == 3 :
        return x[2] + x[1] + x[0]

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
    
if __name__ == '__main__':
    main()

Fixed submission:
s = input()

x = s
if len(s) == 2 :
    print (s)
elif len(s) == 3 :
    print (x[2] + x[1] + x[0])
Buggy python submission (verdict: Runtime Error):
import sys

def solve(R):
    if R < 1200 :
        return 'ABC'
    elif R < 2800 :
        return 'ARC'
    else :
        return 'AGC'

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    R = int(ws[0])
    return (R,)

def main():
    solve(*readQuestion())

Uncomment before submission
main()

Fixed submission:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(R): #104-A
    if 1200>R :
        return 'ABC'
    if 2800>R :
        return 'ARC'
    else:
        return 'AGC'

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a,b=int(input().split())
ad = a+b
minus = a-b
cross = a*b
lis = [ad, minus, cross]
print(max(lis))

Fixed submission:
a,b=input().split()
a = int(a)
b = int(b)
ad = a+b
minus = a-b
cross = a*b
lis = [ad, minus, cross]
print(max(lis))

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
ad = a+b
minus = a-b
cross = a*b
lis = [ad, minus, cross]
print(max(lis))

Fixed submission:
a,b=input().split()
a = int(a)
b = int(b)
ad = a+b
minus = a-b
cross = a*b
lis = [ad, minus, cross]
print(max(lis))

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
add = a+b
minus = a-b
cross = a*b
lis = [add, minus, cross]
print(max(lis))

Fixed submission:
a,b=input().split()
a = int(a)
b = int(b)
ad = a+b
minus = a-b
cross = a*b
lis = [ad, minus, cross]
print(max(lis))

Buggy python submission (verdict: Runtime Error):
import numpy as np
a = int(input())
b = int(input())
add = a+b
minus = a-b
cross = a*b
lis = np.array([add, minus, cross])
print(np.max(lis))

Fixed submission:
a,b=input().split()
a = int(a)
b = int(b)
ad = a+b
minus = a-b
cross = a*b
lis = [ad, minus, cross]
print(max(lis))
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())
for i in range(N):
    if i*(A+B) < N <= (i+1)*(A+B):
        print(min(N-i*B, (i+1)*A))

Fixed submission:
N, A, B = map(int, input().split())
a = N//(A+B)
b = N % (A+B)

if A == 0:
    print(0)
elif b <= A:
    print(a*A+b)
else:
    print(a*A+A)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A-2*B > 0:
    print(A-2*B)
else:
    print('0')

Fixed submission:
S = input()
day = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7-day.index(S))
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A-2*B > 0:
    print(A-2*B)
else:
    print('0')

Fixed submission:
A, B = map(int, input().split())
if A-2*B > 0:
    print(A-2*B)
else:
    print('0')
Buggy python submission (verdict: Runtime Error):
S = input()
if S[1] == S[2] or S[2] == S[3] or S[3] == S[4]:
    print("Bad")
else:
    print("Good")


Fixed submission:
S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
    print("Bad")
else:
    print("Good")

Buggy python submission (verdict: Runtime Error):
S = input()
if S[1] == S[2]or S[2] == S[3]or S[3] == S[4]:
    print("Bad")
else:
    print("Good")


Fixed submission:
S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
a = []
a.append(10-(A % 10))
a.append(10-(B % 10))
a.append(10-(C % 10))
a.append(10-(D % 10))
a.append(10-(E % 10))
b = []
for i in range(5):
    if a[i] != 10:
        b.append(a[i])
c = A+B+C+D+E+sum(b)-max(b)
print(c)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
a = []
a.append(10-(A % 10))
a.append(10-(B % 10))
a.append(10-(C % 10))
a.append(10-(D % 10))
a.append(10-(E % 10))
b = [0]
for i in range(5):
    if a[i] != 10:
        b.append(a[i])
c = A+B+C+D+E+sum(b)-max(b)
print(c)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
a = []
a.append(10-(A % 10))
a.append(10-(B % 10))
a.append(10-(C % 10))
a.append(10-(D % 10))
a.append(10-(E % 10))
b = []
for i in range(5):
    if a[i] != 10:
        b.append(a[i])
c = A+B+C+D+E+sum(b)-max(b)
print(c)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
a = []
a.append(10-(A % 10))
a.append(10-(B % 10))
a.append(10-(C % 10))
a.append(10-(D % 10))
a.append(10-(E % 10))
b = [0]
for i in range(5):
    if a[i] != 10:
        b.append(a[i])
c = A+B+C+D+E+sum(b)-max(b)
print(c)
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
if N == 1:
    print("Hello World")
else:
    print(A+B)

Fixed submission:
N = int(input())
if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A+B)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
if N == "1":
    print("Hello World")
else:
    print(A+B)

Fixed submission:
N = int(input())
if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A+B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(map(str, input().split()))
A = 0
for i in range(N):
    for j in range(N-1):
        for k in range(N-2):
            for l in range(N-3):
                if S[i] != S[j+1] and S[j+1] != S[k+2]and S[k+2] != S[l+3] and S[l+3] != S[i] and S[j+1] != S[l+3] and S[i] != S[k+2]:
                    A = A+1
if A != 0:
    print("Four")
else:
    print("Three")


Fixed submission:
N = int(input())
S = list(map(str, input().split()))
if ("P"and "W" and "G" and "Y") in S:
    print("Four")
else:
    print("Three")
Buggy python submission (verdict: Runtime Error):
A, B, C, X = map(int, input().split())
count = 0
for i in range(A+1):
    for j in range(B+1):
        for n in range(C+1):
            if i*500+j*100+n*50 == X:
                count = count+1
print(count)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for i in range(A+1):
    for j in range(B+1):
        for n in range(C+1):
            if i*500+j*100+n*50 == X:
                count = count+1
print(count)
Buggy python submission (verdict: Runtime Error):
pb_list = []
p_count = 0

def pb(n):
    if n == 0:
        pb_list.append('p')
        p_count = p_count + 1
        return
    elif n >= 0:
        pb_list.append('b')
        pb(n - 1)
        pb_list.append('p')
        p_count = p_count + 1
        pb(n - 1)
        pb_list.append('b')
    else:
        return

n, x = input().split(' ')
n = int(n)
x = int(x)
pb(n)

#for i in range(x):
#    if pb_list[i] == 'p':
#        p_count = p_count + 1

print(p_count)

Fixed submission:
c = int(input())

if c == 25:
    print("Christmas")
elif c == 24:
    print("Christmas Eve")
elif c == 23:
    print("Christmas Eve Eve")
elif c == 22:
    print("Christmas Eve Eve Eve")
else:
    pass
Buggy python submission (verdict: Runtime Error):
k,n=map(int,input().split())
    a=list(map(int,input().split()))
    max_d=0
    for i in range(n):
        x=0
        if i==n-1:
           if a[0]==0:
               x=k-a[i]
           else:
               x=k-a[i]+a[0]
        else:
            x=a[i+1]-a[i]
        if x>max_d:
            max_d=x
    print(k-max_d)

Fixed submission:
k,n=map(int,input().split())
a=list(map(int,input().split()))
max_d=0
for i in range(n):
    x=0
    if i==n-1:
        if a[0]==0:
            x=k-a[i]
        else:
            x=k-a[i]+a[0]
    else:
        x=a[i+1]-a[i]
    if x>max_d:
        max_d=x
print(k-max_d)

Buggy python submission (verdict: Runtime Error):
t=int(input())
while(t):
    t-=1
    k,n=map(int,input().split())
    a=list(map(int,input().split()))
    max_d=0
    for i in range(n):
        x=0
        if i==n-1:
           if a[0]==0:
               x=k-a[i]
           else:
               x=k-a[i]+a[0]
        else:
            x=a[i+1]-a[i]
        if x>max_d:
            max_d=x
    print(k-max_d)

Fixed submission:
k,n=map(int,input().split())
a=list(map(int,input().split()))
max_d=0
for i in range(n):
    x=0
    if i==n-1:
        if a[0]==0:
            x=k-a[i]
        else:
            x=k-a[i]+a[0]
    else:
        x=a[i+1]-a[i]
    if x>max_d:
        max_d=x
print(k-max_d)
Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
total=b-a+1
f1=(b//c)-(a//c)
if a%c==0:
    f1+=1
f2=(b//d)-(a//d)
if a%d==0:
    f2+=1
gcd=math.gcd(c,d)
lcm=(c*d)//gcd
f3=(b//lcm)-(a//lcm)
if a%lcm==0:
    f3+=1
f=f1+f2-f3
print(total-f)


Fixed submission:
def gcd(x, y):
    while (y):
        x, y = y, x % y
    return x
a,b,c,d=map(int,input().split())
total=b-a+1
f1=(b//c)-(a//c)
if a%c==0:
    f1+=1
f2=(b//d)-(a//d)
if a%d==0:
    f2+=1
gcd=gcd(c,d)
lcm=(c*d)//gcd
f3=(b//lcm)-(a//lcm)
if a%lcm==0:
    f3+=1
f=f1+f2-f3
print(total-f)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
total=b-a+1
f1=(b//c)-(a//c)
if a%c==0:
    f1+=1
f2=(b//d)-(a//d)
if a%d==0:
    f2+=1
gcd=math.gcd(c,d)
lcm=(c*d)//gcd
f3=(b//lcm)-(a//lcm)
if a%lcm==0:
    f3+=1
f=f1+f2-f3
print(total-f)


Fixed submission:
def gcd(x, y):
    while (y):
        x, y = y, x % y
    return x
a,b,c,d=map(int,input().split())
total=b-a+1
f1=(b//c)-(a//c)
if a%c==0:
    f1+=1
f2=(b//d)-(a//d)
if a%d==0:
    f2+=1
gcd=gcd(c,d)
lcm=(c*d)//gcd
f3=(b//lcm)-(a//lcm)
if a%lcm==0:
    f3+=1
f=f1+f2-f3
print(total-f)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
stdin = open("input.txt")

if __name__ == "__main__":
  N = int(stdin.readline())
  S = stdin.readline().rstrip()
  
  print(S.count("ABC"))

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

if __name__ == "__main__":
  N = int(stdin.readline())
  S = stdin.readline().rstrip()
  
  print(S.count("ABC"))
Buggy python submission (verdict: Runtime Error):
def resolve():
  found = False
  N = int(input())
  for x in range(int(N/1.08), int((N+1)/1.08+1)):
    if N == math.floor(x*1.08):
      print(x)
      found = True
      break
  
  if not found:
    print(":(")
  
resolve()

Fixed submission:
import math
def resolve():
  found = False
  N = int(input())
  for x in range(int(N/1.08), int((N+1)/1.08+1)):
    if N == math.floor(x*1.08):
      print(x)
      found = True
      break
  
  if not found:
    print(":(")

resolve()
Buggy python submission (verdict: Runtime Error):
def main_C1():

  N = int(input())
  a = [[int(item) for item in input().split()] for i in range(N)]
  
  dp = [[0, 0, 0] for i in range(N+1)]

  for i in range(N):
    for j in range(3):
      for k in range(3):
        if j == k:
          continue
        dp[i+1][k] = max(dp[i+1][k], dp[i][j] + a[i][k])
  
  print(max(dp[-1]))

if __name__ == "__main__":
  main_C1()
  # print(list(input_gen()))


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

inf = float("inf")
cost = [inf]*N

cost[0] = 0
for i in range(1, N):
  cost[i] = min(cost[i], cost[i-1] + abs(h[i] - h[i-1]))
  
  if i - 2 >= 0:
    cost[i] = min(cost[i], cost[i-2] + abs(h[i] - h[i-2]))

print(cost[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

inf = float("inf")
cost = [inf]*N

cost[0] = 0
m = min
for i in range(N):
  for step in range(1, K+1):
    if i + step < N:
      cost[i+step] = m(cost[i+step], cost[i] + abs(h[i] - h[i+step]))

print(cost[-1])

Fixed submission:
def main_B1():
  N, K = [int(i) for i in input().split()]
  h = [int(i) for i in input().split()]

  inf = float("inf")
  cost = [inf]*N


  cost[0] = 0
  for i in range(1, N):
    cost[i] = min([cost[j] + abs(h[i] - h[j]) for j in range(max(0, i-K), i)])
  print(cost[-1])

if __name__ == "__main__":
  main_B1()

Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

inf = float("inf")
cost = [inf]*N

cost[0] = 0
for i in range(N):
  for step in range(1, K+1):
    if i + step < N:
      cost[i+step] = min(cost[i+step], cost[i] + abs(h[i] - h[i+step]))

print(cost[-1])

Fixed submission:
def main_B1():
  N, K = [int(i) for i in input().split()]
  h = [int(i) for i in input().split()]

  inf = float("inf")
  cost = [inf]*N


  cost[0] = 0
  for i in range(1, N):
    cost[i] = min([cost[j] + abs(h[i] - h[j]) for j in range(max(0, i-K), i)])
  print(cost[-1])

if __name__ == "__main__":
  main_B1()
Buggy python submission (verdict: Runtime Error):
def main_C1():

  N = int(input())
  a = [[int(item) for item in line.split()] for line in input()]
  
  dp = [[0, 0, 0] for i in range(N+1)]

  for i in range(N):
    for j in range(3):
      for k in range(3):
        if j == k:
          continue
        dp[i+1][k] = max(dp[i+1][k], dp[i][j] + a[i][k])
  
  print(max(dp[-1]))

if __name__ == "__main__":
  main_C1()
  # print(list(input_gen()))

Fixed submission:
def main_C1():

  N = int(input())
  a = [[int(item) for item in input().split()] for i in range(N)]
  
  dp = [[0, 0, 0] for i in range(N+1)]

  for i in range(N):
    for j in range(3):
      for k in range(3):
        if j == k:
          continue
        dp[i+1][k] = max(dp[i+1][k], dp[i][j] + a[i][k])
  
  print(max(dp[-1]))

if __name__ == "__main__":
  main_C1()
  # print(list(input_gen()))