Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
def input():
    return sys.stdin.readline().rstrip('\n')

def calc(S):
    N = len(S)
    r = 0
    d = [0] * 2019
    d[0] = 1
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * 10 ** i) % 2019
        d[r] += 1
    ans = 0
    for c in d:
        ans += c * (c - 1) // 2
    return ans


S = input()
print(calc(S))

Fixed submission:
import sys
def input():
    return sys.stdin.readline().rstrip('\n')

def calc(S):
    N = len(S)
    r = 0
    d = [0] * 2019
    p = 1
    d[0] = 1
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * p) % 2019
        p = (p * 10) % 2019
        d[r] += 1
    ans = 0
    for c in d:
        ans += c * (c - 1) // 2
    return ans


S = input()
print(calc(S))

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

def calc(S):
    N = len(S)
    r = 0
    d = [0] * 2019
    d[0] = 1
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * 10 ** i) % 2019
        d[r] += 1
    ans = 0
    for c in d:
        ans += c * (c - 1) // 2
    return ans


S = sys.stdin.readline() # input()
print(calc(S))

Fixed submission:
import sys
def input():
    return sys.stdin.readline().rstrip('\n')

def calc(S):
    N = len(S)
    r = 0
    d = [0] * 2019
    p = 1
    d[0] = 1
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * p) % 2019
        p = (p * 10) % 2019
        d[r] += 1
    ans = 0
    for c in d:
        ans += c * (c - 1) // 2
    return ans


S = input()
print(calc(S))

Buggy python submission (verdict: Time Limit Exceeded):
def calc(S):
    N = len(S)
    r = 0
    d = [0 for _ in range(2019)]
    d[0] = 1
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * 10 ** i) % 2019
        d[r] += 1
    ans = 0
    for c in d:
        ans += c * (c - 1) // 2
    return ans


S = input()
print(calc(S))

Fixed submission:
import sys
def input():
    return sys.stdin.readline().rstrip('\n')

def calc(S):
    N = len(S)
    r = 0
    d = [0] * 2019
    p = 1
    d[0] = 1
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * p) % 2019
        p = (p * 10) % 2019
        d[r] += 1
    ans = 0
    for c in d:
        ans += c * (c - 1) // 2
    return ans


S = input()
print(calc(S))

Buggy python submission (verdict: Time Limit Exceeded):
def calc(S):
    N = len(S)
    r = 0
    d = {0: 1}
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * 10 ** i) % 2019
        d[r] = (d[r] if r in d else 0) + 1
    ans = 0
    for c in d:
        ans += d[c] * (d[c] - 1) // 2
    return ans


S = input()
print(calc(S))

Fixed submission:
import sys
def input():
    return sys.stdin.readline().rstrip('\n')

def calc(S):
    N = len(S)
    r = 0
    d = [0] * 2019
    p = 1
    d[0] = 1
    for i in range(N):
        r = (r + int(S[N - 1 - i]) * p) % 2019
        p = (p * 10) % 2019
        d[r] += 1
    ans = 0
    for c in d:
        ans += c * (c - 1) // 2
    return ans


S = input()
print(calc(S))
Buggy python submission (verdict: Time Limit Exceeded):
def calc(N, S):
    id = {'R': 0, 'G': 1, 'B': 2}
    rgb = [[0, 0, 0] for _ in range(N)]
    rgb[0][id[S[0]]] = 1
    for i in range(1, N):
        for j in [0, 1, 2]:
            rgb[i][j] = rgb[i - 1][j]
            if j == id[S[i]]:
                rgb[i][j] += 1
    result = 0
    for i in range(N - 1, -1, -1):
        X = S[i]
        YZ = (['G', 'B'] if X == 'R' else ['R', 'B'] if X == 'G' else ['R', 'G'])
        j = i - 1
        while j > -1:
            if S[j] in YZ:
                result += rgb[j][3 - id[X] - id[S[j]]]
                if 2 * j - i > -1 and not S[2 * j - i] in [X, S[j]]:
                    result -=1
            j -= 1
    return result


N = int(input())
S = input()
print(calc(N, S))

Fixed submission:
def calc(N, S):
    id = {'R': 0, 'G': 1, 'B': 2}
    rgb = [[0, 0, 0] for _ in range(N)]
    rgb[0][id[S[0]]] = 1
    for i in range(1, N):
        for j in [0, 1, 2]:
            rgb[i][j] = rgb[i - 1][j]
            if j == id[S[i]]:
                rgb[i][j] += 1
    result = 0
    for i in range(N - 1, -1, -1):
        X = S[i]
        YZ = (['G', 'B'] if X == 'R' else ['R', 'B'] if X == 'G' else ['R', 'G'])
        j = i - 1
        while j > -1:
            if S[j] in YZ:
                result += rgb[j][3 - id[X] - id[S[j]]]
                if 2 * j - i > -1 and not S[2 * j - i] in [X, S[j]]:
                    result -=1
            j -= 1
    return result


N = int(input())
S = input()
print(calc(N, S))
Buggy python submission (verdict: Runtime Error):
def calc(N, D):
    if D[0] != 0:
        return 0
    d = {}
    for Di in D:
        d[Di] = 1 + (d[Di] if Di in d else 0)
    if d[0] != 1:
        return 0
    result = 1
    for i in range(max(d.keys())):
        if d[i + 1] == 0:
            return 0
        result *= d[i] ** d[i + 1]
    return result


N = int(input())
D = [int(s) for s in input().split()]
print(calc(N, D))

Fixed submission:
Z = 998244353


def calc(N, D):
    if D[0] != 0:
        return 0
    d = {}
    for Di in D:
        d[Di] = 1 + (d[Di] if Di in d else 0)
    if d[0] != 1:
        return 0
    result = 1
    for i in range(max(d.keys())):
        if not i + 1 in d:
            return 0
        result *= (d[i] ** d[i + 1]) % Z
        result = result % Z
    return result


N = int(input())
D = [int(s) for s in input().split()]
print(calc(N, D))
Buggy python submission (verdict: Runtime Error):
def calc(a, b, x):
    if x > a * a * b / 2:
        y = 2 * (a * a * b - x) / a ** 3
        return m.degrees(m.atan(y))
    else:
        y = a * b * b / 2 / x
        return m.degrees(m.atan(y))


(a, b, x) = tuple([int(s) for s in input().split()])
print(calc(a, b, x))

Fixed submission:
import math as m


def calc(a, b, x):
    if x > a * a * b / 2:
        y = 2 * (a * a * b - x) / a ** 3
        return m.degrees(m.atan(y))
    else:
        y = a * b * b / 2 / x
        return m.degrees(m.atan(y))


(a, b, x) = tuple([int(s) for s in input().split()])
print(calc(a, b, x))
Buggy python submission (verdict: Runtime Error):
def calc(S, T):
    U = [(S[0], 1)]
    un = 0
    for i in range(1, len(S)):
        if U[un][0] == S[i]:
            U[un] = (U[un][0], U[un][1] + 1)
        else:
            U += [(S[i], 1)]
            un += 1
    U = [u for u in U if u[1] > 1]
    un = len(U) - 1
    if un == 0:
        return (U[0][1] * T) // 2
    else:
        if U[0][0] != U[un][0]:
            return sum([u[1] // 2 for u in U]) * T
        else:
            return U[0][1] // 2 + U[un][1] // 2 \
                + (U[0][1] + U[un][1]) // 2 * (T - 1) \
                + sum([u[1] // 2 for u in U[1:un]]) * T


S = input()
T = int(input())
print(calc(S, T))

Fixed submission:
def calc(S, T):
    U = [(S[0], 1)]
    un = 0
    for i in range(1, len(S)):
        if U[un][0] == S[i]:
            U[un] = (U[un][0], U[un][1] + 1)
        else:
            U += [(S[i], 1)]
            un += 1
    if un == 0:
        return (U[0][1] * T) // 2
    else:
        if U[0][0] != U[un][0]:
            return sum([u[1] // 2 for u in U]) * T
        else:
            return U[0][1] // 2 + U[un][1] // 2 \
                + (U[0][1] + U[un][1]) // 2 * (T - 1) \
                + sum([u[1] // 2 for u in U[1:un]]) * T


S = input()
T = int(input())
print(calc(S, T))
Buggy python submission (verdict: Time Limit Exceeded):
def calc(N, M, a, c):
    inf = 10 ** 7 + 1
    L = 2 ** N
    dp = [inf for _ in range(L)]
    dp[0] = 0
    C = [sum([_c[i] * 2 ** i for i in range(N)]) for _c in c]
    for _ in range(M):
        dp_x = list(dp)
        for i in range(M):
            for j in range(L):
                if dp[j] == inf:
                    continue
                dp_x[j | C[i]] = min(dp_x[j | C[i]], dp[j] + a[i])
            dp = dp_x
        if dp[L - 1] < inf:
            return dp[L - 1]
    return -1


(N, M) = tuple([int(s) for s in input().split(' ')])
a = [0 for _ in range(M)]
c = [[0 for _ in range(N)] for _ in range(M)]
for i in range(M):
    (_a, _b) = tuple([int(s) for s in input().split(' ')])
    a[i] = _a
    for _c in [int(s) for s in input().split(' ')]:
        c[i][_c - 1] = 1
print(calc(N, M, a, c))

Fixed submission:
def calc(N, M, a, c):
    for j in range(N):
        u = sum([c[i][j] for i in range(M)])
        if u == 0:
            return -1
    inf = 10 ** 7 + 1
    L = 2 ** N
    dp = [inf for _ in range(L)]
    dp[0] = 0
    C = [sum([_c[i] * 2 ** i for i in range(N)]) for _c in c]
    for _ in range(M):
        dp_x = list(dp)
        for i in range(M):
            for j in range(L):
                if dp[j] == inf:
                    continue
                dp_x[j | C[i]] = min(dp_x[j | C[i]], dp[j] + a[i])
            dp = dp_x
        if dp[L - 1] < inf:
            return dp[L - 1]
    return -1


(N, M) = tuple([int(s) for s in input().split(' ')])
a = [0 for _ in range(M)]
c = [[0 for _ in range(N)] for _ in range(M)]
for i in range(M):
    (_a, _b) = tuple([int(s) for s in input().split(' ')])
    a[i] = _a
    for _c in [int(s) for s in input().split(' ')]:
        c[i][_c - 1] = 1
print(calc(N, M, a, c))
Buggy python submission (verdict: Runtime Error):
def calc(N, A):
    _exist = False
    counter = {}
    for a in A:
        counter[a] = 1 + (counter[a] if a in counter else 0)
    keys = counter.keys()
    values = counter.values()
    d = max(values) - min(values)
    if (N % 3 == 0 and len(counter) == 3 and d == 0):
        _exist = keys[0] ^ keys[1] == keys[2]
    else:
        _exist = 0 in counter and counter[0] == N
    print('Yes' if _exist else 'No')


N = int(input())
A = [int(s) for s in input().split(' ')]
calc(N, A)

Fixed submission:
def calc(N, A):
    _exist = False
    counter = {}
    for a in A:
        counter[a] = 1 + (counter[a] if a in counter else 0)
    if (N % 3 == 0 and len(counter) == 3):
        keys = list(counter.keys())
        values = list(counter.values())
        d = max(values) - min(values)
        _exist = d == 0 and keys[0] ^ keys[1] == keys[2]
    elif (N % 3 == 0 and len(counter) == 2):
        keys = list(counter.keys())
        values = list(counter.values())
        d = max(values) - min(values)
        _exist = d == N // 3 and (keys[0] == 0 or keys[1] == 0)
    else:
        _exist = 0 in counter and counter[0] == N
    print('Yes' if _exist else 'No')


N = int(input())
A = [int(s) for s in input().split(' ')]
calc(N, A)

Buggy python submission (verdict: Runtime Error):
def calc(N, A):
    _exist = False
    counter = {}
    for a in A:
        counter[a] = 1 + (counter[a] if a in counter else 0)
    keys = counter.keys()
    values = counter.values()
    d = max(values) - min(values)
    if (N % 3 == 0 and d == 0):
        _exist = keys[0] + keys[1] == keys[2]
    else:
        _exist = 0 in counter and counter[0] == N
    print('Yes' if _exist else 'No')


N = int(input())
A = [int(s) for s in input().split(' ')]
calc(N, A)

Fixed submission:
def calc(N, A):
    _exist = False
    counter = {}
    for a in A:
        counter[a] = 1 + (counter[a] if a in counter else 0)
    if (N % 3 == 0 and len(counter) == 3):
        keys = list(counter.keys())
        values = list(counter.values())
        d = max(values) - min(values)
        _exist = d == 0 and keys[0] ^ keys[1] == keys[2]
    elif (N % 3 == 0 and len(counter) == 2):
        keys = list(counter.keys())
        values = list(counter.values())
        d = max(values) - min(values)
        _exist = d == N // 3 and (keys[0] == 0 or keys[1] == 0)
    else:
        _exist = 0 in counter and counter[0] == N
    print('Yes' if _exist else 'No')


N = int(input())
A = [int(s) for s in input().split(' ')]
calc(N, A)
Buggy python submission (verdict: Time Limit Exceeded):
import math as m

Z = 10 ** 9 + 7

conb_table = {}
def conb(S, i):
    if (not (S in conb_table)):
        conb_table[S] = {}
    if (i in conb_table[S]):
        return conb_table[S][i]
    if (i == 1):
        v = 1
    elif (i == 2):
        v = S - 1
    elif (i == 3):
        v = (S - 1) * (S - 2) // 2
    else:
        v = 0
        for j in range(1, S - i + 2):
            v += conb(S - j, i - 1)
    conb_table[S][i] = v
    return v

def calc(N, K):
    M = N - K + 1
    M_fact = m.factorial(M)
    result = ''
    for i in range(1, K + 1):
        if (M - i < 0):
            val = 0
        else:
            val = m.factorial(M) // m.factorial(i) // m.factorial(M - i) * conb(K, i)
        result += "{}\n".format(
            val if val < Z else val % Z
            )
    print(result)

s = input().split(' ')
N = int(s[0])
K = int(s[1])

calc(N, K)

Fixed submission:
import math as m

Z = 10 ** 9 + 7


def calc(N, K):
    M = N - K + 1
    M_fact = m.factorial(M)
    K1_fact = m.factorial(K - 1)
    result = ''
    for i in range(1, K + 1):
        if (M - i < 0):
            val = 0
        else:
            val = M_fact // m.factorial(i) // m.factorial(M - i) * \
                K1_fact // m.factorial(i - 1) // m.factorial(K - i)
        result += "{}\n".format(
            val if val < Z else val % Z
        )
    print(result)


s = input().split(' ')
N = int(s[0])
K = int(s[1])

calc(N, K)

Buggy python submission (verdict: Runtime Error):
import math as m

Z = 10 ** 9 + 7

def conb(S, i):
    if (i == 1):
        return 1
    elif (i == 2):
        return S - 1
    elif (i == 3):
        return (S - 1) * (S - 2) // 2
    else:
        n = 0
        for j in range(1, S - i + 2):
            n += conb(S - j, i - 1)
        return n

def calc(N, K):
    M = N - K + 1
    M_fact = m.factorial(M)
    result = ''
    for i in range(1, K + 1):
        val = m.factorial(M) // m.factorial(i) // m.factorial(M - i) * conb(K, i)
        result += "{}\n".format(
            val if val < Z else val % Z
            )
    print(result)

s = input().split(' ')
N = int(s[0])
K = int(s[1])

calc(N, K)

Fixed submission:
import math as m

Z = 10 ** 9 + 7


def calc(N, K):
    M = N - K + 1
    M_fact = m.factorial(M)
    K1_fact = m.factorial(K - 1)
    result = ''
    for i in range(1, K + 1):
        if (M - i < 0):
            val = 0
        else:
            val = M_fact // m.factorial(i) // m.factorial(M - i) * \
                K1_fact // m.factorial(i - 1) // m.factorial(K - i)
        result += "{}\n".format(
            val if val < Z else val % Z
        )
    print(result)


s = input().split(' ')
N = int(s[0])
K = int(s[1])

calc(N, K)
Buggy python submission (verdict: Runtime Error):
splited = input().split(' ')
N = int(splited[0])
K = int(splited[1])
 
if(K == 1):
    print(0)
else
    print(N - K)

Fixed submission:
splited = input().split(' ')
N = int(splited[0])
K = int(splited[1])
 
if(K == 1):
    print(0)
else:
    print(N - K)

Buggy python submission (verdict: Runtime Error):
splited = input().split(' ')
N = int(splited[0])
K = int(splited[1])

if(K == 1):
    return 0
else
    return N - K

Fixed submission:
splited = input().split(' ')
N = int(splited[0])
K = int(splited[1])
 
if(K == 1):
    print(0)
else:
    print(N - K)
Buggy python submission (verdict: Runtime Error):
N = int(input())
D = []
for i in range(N):
    a = list(map(int,input().split()))
    if(a[0] == a[1]):
        D.append(1)
    else:
        D.append(0)
for i in range(N-2):
    if D[i] == D[i+1] == D[i+2] == 1:
        tf = 1
if tf == 1:
    print("Yes")
else:
    print("No")

Fixed submission:
N = int(input())
D = []
for i in range(N):
    a = list(map(int,input().split()))
    if(a[0] == a[1]):
        D.append(1)
    else:
        D.append(0)
tf = 0
for i in range(N-2):
    if D[i] == D[i+1] == D[i+2] == 1:
        tf = 1
if tf == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d)

Fixed submission:
a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d))

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input())
print(max(a*c,a*d,b*c,b*d))


Fixed submission:
a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
add = 0
for i in range(N):
    tmp = sum(A[i+1:N])
    add += tmp * A[i]
print(add%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
add = 0
tmp = sum(A)
for i in range(N):
    tmp -= A[i]
    add += tmp * A[i]
print(add%mod)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
add = 0
for i in range(N):
    tmp = sum(A[i+1:N])
    add += tmp * A[i]
print(add%mod

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
add = 0
tmp = sum(A)
for i in range(N):
    tmp -= A[i]
    add += tmp * A[i]
print(add%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
sum = 0
for i in range(N):
    for j in range(i+1,N):
        sum += (A[i] * A[j])
print(sum%mod)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
add = 0
tmp = sum(A)
for i in range(N):
    tmp -= A[i]
    add += tmp * A[i]
print(add%mod)
Buggy python submission (verdict: Runtime Error):
D = int(input())
c = list(map(int,input().split()))
s = []
for i in range(D):
    s.append(list(map(int,input().split())))

def last(d,la):
    s = 0

    for i in range(26):
        if la[i] == 0 and  i == d:
            s += c[i] * (d - la[i]-1)
        else:
            s += c[i] * (d - la[i])
    return s

lastday = [0]*26
a = 0

for d in range(D):

    eff = s[d][0] - last(d+1,lastday)
    ret = 0
    for t in range(26):
        bef = lastday[t]
        #lastday[t] = d+1
        
        now = s[d][t] - last(d+1,lastday)
        if eff < now:
            eff = now 
            ret = t

        lastday[t] = bef
        
    lastday[ret] = d+1
    a += eff
    print(ret+1

Fixed submission:
D = int(input())
c = list(map(int,input().split()))
s = []
for i in range(D):
    s.append(list(map(int,input().split())))

def last(d,la):
    s = 0

    for i in range(26):
        if la[i] == 0 and  i == d:
            s += c[i] * (d - la[i]-1)
        else:
            s += c[i] * (d - la[i])
    return s

lastday = [0]*26
a = 0

for d in range(D):

    eff = s[d][0] - last(d+1,lastday)
    ret = 0
    for t in range(26):
        bef = lastday[t]
        #lastday[t] = d+1
        
        now = s[d][t] - last(d+1,lastday)
        if eff < now:
            eff = now 
            ret = t

        lastday[t] = bef
        
    lastday[ret] = d+1
    a += eff
    print(ret+1)

Buggy python submission (verdict: Runtime Error):
D = int(input())
c = list(map(int,input().split()))
s = []
for i in range(D):
    s.append(list(map(int,input().split())))

def last(d,la):
    s = 0
    for i in range(26):
        s += c[i] * (d - la[i])
    return s

lastday = [0]*26
a = 0

for d in range(D):

    eff = s[d][0] - last(d+1,lastday)
    for t in range(26):
        bef = lastday[t]
        lastday[t] = d+1

        now = s[d][t] - last(d+1,lastday)
        if eff < now:
            eff = now 
            ret = t

        lastday[t] = bef
        
    lastday[ret] = d+1
    a += eff
    print(ret+1)

Fixed submission:
D = int(input())
c = list(map(int,input().split()))
s = []
for i in range(D):
    s.append(list(map(int,input().split())))

def last(d,la):
    s = 0

    for i in range(26):
        if la[i] == 0 and  i == d:
            s += c[i] * (d - la[i]-1)
        else:
            s += c[i] * (d - la[i])
    return s

lastday = [0]*26
a = 0

for d in range(D):

    eff = s[d][0] - last(d+1,lastday)
    ret = 0
    for t in range(26):
        bef = lastday[t]
        #lastday[t] = d+1
        
        now = s[d][t] - last(d+1,lastday)
        if eff < now:
            eff = now 
            ret = t

        lastday[t] = bef
        
    lastday[ret] = d+1
    a += eff
    print(ret+1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
s = 1
if 0 in A:
    print(0)
    exit(0)
for i in A:
    s *= i
if s > 10**(18):
    print(-1)
else:
    print(s)

Fixed submission:
import numpy as np
N = int(input())
A = list(map(int,input().split()))
s = 1
if 0 in A:
    print(0)
    exit(0)
for i in A:
    s *= i
    if s > 10**(18):
        print(-1)
        exit(0)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
s = 1
for a in A:
    s *= a
if s>10**(18):
    print(-1)
else:
    print(s)


Fixed submission:
import numpy as np
N = int(input())
A = list(map(int,input().split()))
s = 1
if 0 in A:
    print(0)
    exit(0)
for i in A:
    s *= i
    if s > 10**(18):
        print(-1)
        exit(0)
print(s)
Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())

a = H * 30 + M * 0.5
b = M * 6
c = abs(a-b)
c = math.radians(c)
c = abs(math.cos(c))
if c == 0:
    print(abs(B-A))
else:
    d = math.sqrt(A**2 + B**2 - 2 * A * B * c)
    print(d)

Fixed submission:
N = int(input())

a = N%100
a = a%10

if a == 0 or a == 1 or a == 6 or a == 8:
    print("pon")
elif a == 3:
    print("bon")
else:
    print("hon")

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

a = N%100
a = a%10

if a == 0 or a == 1 or a == 6 or a == 8:
    print("pon")
elif a == 3:
    print("bon")
else:
    print("hon"

Fixed submission:
N = int(input())

a = N%100
a = a%10

if a == 0 or a == 1 or a == 6 or a == 8:
    print("pon")
elif a == 3:
    print("bon")
else:
    print("hon")

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())

a = H * 30 + M * 0.5
b = M * 6
c = abs(a-b)
c = c - 180 if c > 180 else c
c = math.radians(c)
d = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(c))
print(d)

Fixed submission:
N = int(input())

a = N%100
a = a%10

if a == 0 or a == 1 or a == 6 or a == 8:
    print("pon")
elif a == 3:
    print("bon")
else:
    print("hon")

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())

a = H * 30 + M * 0.5
b = M * 6
c = abs(a-b)
c = c - 180 if c > 180 else c
c = math.radians(c)
d = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(c))
print(d)

Fixed submission:
N = int(input())

a = N%100
a = a%10

if a == 0 or a == 1 or a == 6 or a == 8:
    print("pon")
elif a == 3:
    print("bon")
else:
    print("hon")

Buggy python submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())

a = H * 30 + M * 0.5
b = M * 6
c = abs(a-b)
c = c - 180 if c > 180 else c
c = math.radians(c)
d = math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(c))
print(d)

Fixed submission:
N = int(input())

a = N%100
a = a%10

if a == 0 or a == 1 or a == 6 or a == 8:
    print("pon")
elif a == 3:
    print("bon")
else:
    print("hon")

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

a = N%100
a = a%10

if a == 0 or a == 1 or a == 6 or a == 8:
    print("pon")
elif a == 3:
    print("bon")
else:
    print("hon"

Fixed submission:
N = int(input())

a = N%100
a = a%10

if a == 0 or a == 1 or a == 6 or a == 8:
    print("pon")
elif a == 3:
    print("bon")
else:
    print("hon")
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
s = 0
a = 0
b = N

for i in range(1,K):
    s += b - a + 1
    a += i
    b += N - i

u = 0
a = 0
b = N
for i in range(1,N+2):
    u += b - a + 1
    a += i
    b += N - i
print(u-s)

Fixed submission:
import math
R = int(input())
p = math.pi
print(2*R*p)

Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
A = map(int,input().split())

s = sum(A)
if N-s<0:
    print(-1)
else:
    print(N-s)

Fixed submission:
import math
R = int(input())
p = math.pi
print(2*R*p)
Buggy python submission (verdict: Runtime Error):
box = list(map(int,input().split()))
box.reverse()
for x in box:
    print(x,end = " \0")
print("\n",end = "\0"

Fixed submission:
box = list(map(int,input().split()))
print("%d %d %d"%(box[2],box[0],box[1]))