Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#!python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = list(map(int, input().split()))
    T1 = [0]
    s = 0
    for i in range(N):
        s += A[i]
        T1.append(s)
    SUM = s
    T2 = [SUM]
    for i in range(N):
        s -= A[i]
        T2.append(s)

    c = 0
    for i in range(N + 1):
        for j in range(i + 1, N + 1):
            if SUM - T1[i] - T2[j] == 0:
                c += 1
    print(c)
    return 0


if __name__ == '__main__':
    main()


Fixed submission:
#!python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = list(map(int, input().split()))
    T = [0]
    s = 0
    for i in range(N):
        s += A[i]
        T.append(s)

    T.sort()

    _a = None
    n = 0
    c = 0
    for a in T:
        if _a == a:
            n += 1
            c += n
        else:
            n = 0
        _a = a
    print(c)
    return 0


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!python
# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split(' ')))

a = 0
I = []
for b in A + [0]:
    I.append(b - a)
    a = b
S = sum(map(abs, I))

for i in range(N):
    j = i + 1
    A_ = [0] + A + [0]
    if A_[j - 1] <= A_[j] <= A_[j + 1]:
        print(S)
    else:
        I_ = I[:]
        I_[i] = I_[i] + I_[i + 1]
        del I_[i + 1]
        n = sum(map(abs, I_))
        print(n)


Fixed submission:
#!python
# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split(' ')))

a = 0
I = []
for b in A + [0]:
    I.append(b - a)
    a = b
S = sum(map(abs, I))

for i in range(N):
    j = i + 1
    n = S - (abs(I[i]) + abs(I[i + 1])) + abs(I[i] + I[i + 1])
    print(n)

Buggy python submission (verdict: Time Limit Exceeded):
#!python
# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split(' ')))

a = 0
I = 0
for b in A + [0]:
    I += abs(a - b)
    a = b

for i in range(1, N + 1):
    A_ = [0] + A + [0]
    if A_[i - 1] <= A_[i] <= A_[i + 1]:
        print(I)
    else:
        del A_[i]
        a = 0
        n = 0
        for b in A_:
            n += abs(a - b)
            a = b
        print(n)


Fixed submission:
#!python
# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split(' ')))

a = 0
I = []
for b in A + [0]:
    I.append(b - a)
    a = b
S = sum(map(abs, I))

for i in range(N):
    j = i + 1
    n = S - (abs(I[i]) + abs(I[i + 1])) + abs(I[i] + I[i + 1])
    print(n)

Buggy python submission (verdict: Time Limit Exceeded):
#!python
# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split(' ')))

for A_i in A:
    A_ = A[:]
    A_.remove(A_i)
    A_.append(0)
    a = 0
    i = 0
    for b in A_:
        i += abs(a - b)
        a = b
    print(i)


Fixed submission:
#!python
# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split(' ')))

a = 0
I = []
for b in A + [0]:
    I.append(b - a)
    a = b
S = sum(map(abs, I))

for i in range(N):
    j = i + 1
    n = S - (abs(I[i]) + abs(I[i + 1])) + abs(I[i] + I[i + 1])
    print(n)
Buggy python submission (verdict: Time Limit Exceeded):
#!python
# -*- coding: utf-8 -*-


S = input() + '_'
T_s = ["dream", "dreamer", "erase", "eraser"]

while True:
    S_ = S
    for T in T_s:
        S = S.replace(T + "_", "_")
    if S_ == S:
        break

if S == "_":
    print("YES")
else:
    print("NO")


Fixed submission:
#!python
# -*- coding: utf-8 -*-


S = input()
T_s = ["dream", "dreamer", "erase", "eraser"]

while len(S):
    for T in T_s:
        if T == S[-len(T):]:
            S = S[:-len(T)]
            break
    else:
        print("NO")
        break
else:
    print("YES")

Buggy python submission (verdict: Runtime Error):
#!python
# -*- coding: utf-8 -*-


S = input() + '_'
T_s = ["dream", "dreamer", "erase", "eraser"]

while True:
    S_ = S
    for T in T_s:
        S = S.replace(T + "_", "_")
        print(S)
    if S_ == S:
        break

if S == "_":
    print("YES")
else:
    print("NO")


Fixed submission:
#!python
# -*- coding: utf-8 -*-


S = input()
T_s = ["dream", "dreamer", "erase", "eraser"]

while len(S):
    for T in T_s:
        if T == S[-len(T):]:
            S = S[:-len(T)]
            break
    else:
        print("NO")
        break
else:
    print("YES")
Buggy python submission (verdict: Runtime Error):
a, b, t = map(int, list(input()))
total = 0
for i in range(a, t+1, a):
  total += b
print(total)

Fixed submission:
a, b, t = map(int, input().split())
total = 0
for i in range(a, t+1, a):
  total += b
print(total)

Buggy python submission (verdict: Runtime Error):
a, b, t = list(input(''))
total = 0
for i in range(a, t+1, a):
  total += b
print(total)

Fixed submission:
a, b, t = map(int, input().split())
total = 0
for i in range(a, t+1, a):
  total += b
print(total)
Buggy python submission (verdict: Runtime Error):
mx, h = [], []
for ch in input():
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    print(max([len(l) for l in mx]))


Fixed submission:
mx, h = [], []
for ch in str(input()):
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    mx += [h]
    print(max([len(l) for l in mx]))

Buggy python submission (verdict: Runtime Error):
mx, h = [], []
for ch in input():
    print(h)
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    print(max([len(l) for l in mx]))


Fixed submission:
mx, h = [], []
for ch in str(input()):
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    mx += [h]
    print(max([len(l) for l in mx]))

Buggy python submission (verdict: Runtime Error):
mx, h = [], []
for ch in input():
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    print(len(max(mx)))

Fixed submission:
mx, h = [], []
for ch in str(input()):
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    mx += [h]
    print(max([len(l) for l in mx]))
Buggy python submission (verdict: Runtime Error):
N=int(input())
ls_S=list(input())
i=0
I=0
cnt_1=0
cnt_2=0


while ls_S[i]==".":
    i+=1
    I+=1

for x in range(I,N):
    if ls_S[x]==".":
        ls_S[x]="#"
        cnt_1+=1
for x in range(I,N):
    if ls_S[x]=="#":
        ls_S[x]="."
        cnt_2+=1
if cnt_1>cnt_2:
    print(cnt_2)
else:
    print(cnt_1)
        





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

if A<B:
    if A<C<B:
        print("Yes")
    else:
        print("No")
else:
    if B<C<A:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
A,B,C=map(int,input().split())

if A<B:
    if A<C<B:
        print("Yes")
    else:
        print("No")
else:
    if B<C<A:
        print("Yes")
    else:
        print("No")


Fixed submission:
N=int(input())
ls_S=list(input())
K=int(input())

for i in range(N):
    if ls_S[i]!=ls_S[K-1]:
        ls_S[i]="*"
for s in ls_S:
    print(s,end = "")

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

for i in range(N-1):
    if ls_S[i]!=ls_S[K]:
        ls_S[i]="*"
for s in ls_S:
    print(s,end = "")
    


Fixed submission:
N=int(input())
ls_S=list(input())
K=int(input())

for i in range(N):
    if ls_S[i]!=ls_S[K-1]:
        ls_S[i]="*"
for s in ls_S:
    print(s,end = "")
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k=[input() for i in range(6)]
if e-a<=k:
    print("Yay!")
else:
    print(":(")


Fixed submission:
a,b,c,d,e,k=[int(input()) for i in range(6)]
if e-a<=k:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k=map(int,input().split())
if e-a<=k:
    print("Yay!")
else:
    print(":(")


Fixed submission:
a,b,c,d,e,k=[int(input()) for i in range(6)]
if e-a<=k:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
H,W = int(input().split())
h,w = int(input().split())

print(H*W - h*w)

Fixed submission:
H,W = map(int,input().split())
h,w = map(int,input().split())

print((H-h) * (W-w))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
#
#すぬけ君は、犬を N 匹と猿を M 匹飼っています。
#すぬけ君は、この N+M 匹を一列に並べようと思っています。
#文字通り犬猿の仲の犬たちと猿たちを仲直りさせたいすぬけ君は、
#犬同士、または猿同士が隣り合うところができないように並べようと思っています。
#このような並べ方は何通りあるでしょうか。
#犬と猿は 109+7 以上の数を理解できないので、
#並べ方の個数を 109+7 で割ったあまりを求めてください。 
#ただし、犬同士、また猿同士は互いに区別します。また、左右が反転しただけの列も異なる列とみなします。

Data = input().split()
N = int(Data[0])
M = int(Data[1])


if abs(N - M) >= 2:
    print(0)
    
else:
    A = 1
    B = 1
    for i in range(N):
        A = A * (i + 1)

    for i in range(M):
        B = B * (i + 1)

    if N == M:
        ans1 = A * B * 2
    else:
        ans1 = A * B
    
    ans2 = ans1 % (1000000000 + 7)
    
    print(ans2)




Fixed submission:
# -*- coding: utf-8 -*-
#
#すぬけ君は、犬を N 匹と猿を M 匹飼っています。
#すぬけ君は、この N+M 匹を一列に並べようと思っています。
#文字通り犬猿の仲の犬たちと猿たちを仲直りさせたいすぬけ君は、
#犬同士、または猿同士が隣り合うところができないように並べようと思っています。
#このような並べ方は何通りあるでしょうか。
#犬と猿は 109+7 以上の数を理解できないので、
#並べ方の個数を 109+7 で割ったあまりを求めてください。 
#ただし、犬同士、また猿同士は互いに区別します。また、左右が反転しただけの列も異なる列とみなします。

import math

Data = input().split()
N = int(Data[0])
M = int(Data[1])

if abs(N - M) >= 2:
    print(0)
    
else:
    
    A = math.factorial(N)
    B = math.factorial(M)

    if N == M:
        ans1 = A * B * 2
    else:
        ans1 = A * B
    
    ans2 = ans1 % (1000000000 + 7)
    
    print(ans2)
Buggy python submission (verdict: Runtime Error):
x = input().split()

y = x[0] + x[1] + x[2]

if y % 4 == 0:
    print("YES")
else:
    print("NO")



Fixed submission:
x = input().split()

y = int(x[0]) * 100 + int(x[1]) * 10 + int(x[2])

if y%4 == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

x = int(input())
#x = 8

y = input()
#y = ["3","1","4","1","5","9","2","6"]

for i in range(x):
    y[i] = int(y[i])

Max = max(y)
Min = min(y)

ans = Max - Min

print(ans)


Fixed submission:
# -*- coding: utf-8 -*-
 
x = int(input())
#x = 8
 
y = input().split()
#y = ["3","1","4","1","5","9","2","6"]
 
for i in range(x):
    y[i] = int(y[i])
 
Max = max(y)
Min = min(y)
 
ans = Max - Min
 
print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
#レート 1-399：灰色 :gray
#レート 400-799：茶色 :brown
#レート 800-1199：緑色 : green
#レート 1200-1599：水色 :skyblue
#レート 1600-1999：青色 :blue
#レート 2000-2399：黄色 :yellow
#レート 2400-2799：橙色 :orange
#レート 2800-3199：赤色 :red

x = int(input())

y = input().split()

gray = 0
brown = 0
green = 0
skyblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for i in range(x):
    z = int(y[i]) 
    if z < 400:
       gray = 1 
    elif z < 800:
        brown = 1
    elif z < 1200:
        green = 1
    elif z < 1600:
        skyblue = 1
    elif z < 2000:
        blue = 1
    elif z < 2400:
        yellow = 1
    elif z < 2800:
        orange = 1
    elif z < 3200:
        red = 1
    else:
        other = other + 1

if other > 1:
    ans_max = gray + brown + green + skyblue + blue + yellow + orange + red + other
    ans_min = gray + brown + green + skyblue + blue + yellow + orange + red + 1
    
    print(ans_min & " " & ans_max)

else:
    ans = gray + brown + green + skyblue + blue + yellow + orange + red + other
    
    print(ans & " " & ans)
    


Fixed submission:
# -*- coding: utf-8 -*-
#レート 1-399：灰色 :gray
#レート 400-799：茶色 :brown
#レート 800-1199：緑色 : green
#レート 1200-1599：水色 :skyblue
#レート 1600-1999：青色 :blue
#レート 2000-2399：黄色 :yellow
#レート 2400-2799：橙色 :orange
#レート 2800-3199：赤色 :red

x = int(input())
y = input().split()

gray = 0
brown = 0
green = 0
skyblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for i in range(x):
    z = int(y[i]) 
    if z < 400:
       gray = 1 
    elif z < 800:
        brown = 1
    elif z < 1200:
        green = 1
    elif z < 1600:
        skyblue = 1
    elif z < 2000:
        blue = 1
    elif z < 2400:
        yellow = 1
    elif z < 2800:
        orange = 1
    elif z < 3200:
        red = 1
    else:
        other = other + 1

if other >= 1:
    ans_max = gray + brown + green + skyblue + blue + yellow + orange + red + other
    ans_min = gray + brown + green + skyblue + blue + yellow + orange + red + 0
    
    if ans_min == 0:
        ans_min = 1
    
    print(str(ans_min) + " " + str(ans_max))

else:
    ans = gray + brown + green + skyblue + blue + yellow + orange + red + other
    
    print(str(ans) + " " + str(ans))
Buggy python submission (verdict: Runtime Error):
a,b,t = map(int,input().split())
ans = int(b*(t+0.5)/a)
print(c)

Fixed submission:
a,b,t = map(int,input().split())
print(t//a*b)

Buggy python submission (verdict: Runtime Error):
def calc_max_total_jewels_value():
  jewels = int(input())
  jewel_value = [int(x) for x in input().split()]
  jewel_cost = [int(x) for x in input().split()]
  
  max_total_jewels_value = 0
  for jewel_no in range(jewels):
    max_total_jewels_value += max([0, jewel_value[jewel_no] - jewel_cost[jewel_no]])
    
  return max_total_jewels_value

if __name__ == '__main__':
  print(calc_max_total_jewels_value())

Fixed submission:
def count_sum_generated_biscuit():
  generation_interval_sec,\
  biscuit_per_generation,\
  initial_target_sec = [int(x) for x in input().split()]
  
  target_sec = initial_target_sec + 0.5
  sum_generated_biscuit\
  = (target_sec // generation_interval_sec) * biscuit_per_generation
  
  return int(sum_generated_biscuit)
  
if __name__ == '__main__':
  print(count_sum_generated_biscuit())
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

dish_list = [a, b, c, d, e]
min_val = 100
for i, x in enumerate(dish_list):
    if x%10 == 0:
        continue
    val = x % 10
    if val < min_val:
        min_val = val
        idx = i

ans = 0
for i, dish in enumerate(dish_list):
    if i == idx:
        continue

    wait_order =  10 - dish_list[i]%10 if dish_list[i]%10 != 0 else 0

    ans += dish_list[i] + wait_order

print(ans + dish_list[idx])

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

dish_list = [a, b, c, d, e]
min_val = 100
idx = 0
for i, x in enumerate(dish_list):
    if x%10 == 0:
        continue
    val = x % 10
    if val < min_val:
        min_val = val
        idx = i

ans = 0
for i, dish in enumerate(dish_list):
    if i == idx:
        continue

    wait_order =  10 - dish_list[i]%10 if dish_list[i]%10 != 0 else 0

    ans += dish_list[i] + wait_order

print(ans + dish_list[idx])
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

cities = [a, b, c, d, e]
min_val = 10
for i, x in enumerate(cities):
    if x < min_val:
        min_val = x
        idx = i

ans = 0 if idx == 0 else idx

ans += math.ceil(n / min_val)
ans = ans + 4 - idx
print(ans)


Fixed submission:
import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

cities = [a, b, c, d, e]
min_val = 1e18
idx = 0
for i, x in enumerate(cities):
    if x < min_val:
        min_val = x
        idx = i

ans = 0 if idx == 0 else idx

ans += math.ceil(n / min_val)
ans = ans + 4 - idx
print(ans)

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

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

cities = [a, b, c, d, e]
min_val = 1e6
for i, x in enumerate(cities):
    if x < min_val:
        min_val = x
        idx = i

ans = 0 if idx == 0 else idx

ans += math.ceil(n / min_val)
ans = ans + 4 - idx
print(ans)


Fixed submission:
import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

cities = [a, b, c, d, e]
min_val = 1e18
idx = 0
for i, x in enumerate(cities):
    if x < min_val:
        min_val = x
        idx = i

ans = 0 if idx == 0 else idx

ans += math.ceil(n / min_val)
ans = ans + 4 - idx
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x, y, z, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
c.sort(reverse=True)

e = [a_i + b_j for b_j in b for a_i in a]
e.sort(reverse=True)

ans = [e_i + c_j for c_j in c[:k] for e_i in e[:k]]
ans.sort(reverse=True)

for idx in range(k):
    print(ans[idx])

Fixed submission:
x, y, z, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
c.sort(reverse=True)

e = [a_i + b_j for b_j in b for a_i in a]
e.sort(reverse=True)

ans = [e_i + c_j for c_j in c[:k] for e_i in e[:k]]
ans.sort(reverse=True)

for i in ans[:k]:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()

ans = []
for i in range(N):
    s_ = S[i:]
    tmp_ans = []
    for j in range(N, -1, -1):
        if j == 0:
            s = s_
        else:
            s = s_[:-j]

        tmp_ans += [s.count('AC')]
    ans += [tmp_ans]

for _ in range(Q):
    l, r = map(int, input().split())
    print(ans[l-1][r])

Fixed submission:
N, Q = map(int, input().split())
S = input()

t = [0] * (N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()

for _ in range(Q):
    l, r = map(int, input().split())
    s = S[l-1:r]
    ans = 0

    print(s.count('AC'))

Fixed submission:
N, Q = map(int, input().split())
S = input()

t = [0] * (N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()

for _ in range(Q):
    l, r = map(int, input().split())
    s = S[l-1:r]
    ans = 0
    for i in range(len(s)-1):
        if s[i:i+2] == 'AC':
            ans += 1
    print(ans)

Fixed submission:
N, Q = map(int, input().split())
S = input()

t = [0] * (N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce


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


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

Fixed submission:
from functools import reduce


def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

def gcd_list(numbers):
    return reduce(gcd, numbers)


n = int(input())
a = list(map(int, input().split()))
print(gcd_list(a))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]

h = sorted(h)

ans = max(h[0:k]) - min(h[0:k])
for i in range(1, n-k+1):
    ans = min(ans, max(h[i:i+k]) - min(h[i:i+k]))
print(ans)


Fixed submission:
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]
 
h = sorted(h)
 
ans = h[k-1] - h[0]
for i in range(1, n-k+1):
    ans = min(ans, h[i+k-1] - h[i])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]

com = list(itertools.combinations(h, k))

ans = max(com[0]) - min(com[0])
for c in com[1:]:
    ans = min(ans, max(c) - min(c))
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = [int(input()) for _ in range(n)]
 
h = sorted(h)
 
ans = h[k-1] - h[0]
for i in range(1, n-k+1):
    ans = min(ans, h[i+k-1] - h[i])

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

N = int(input())

list = []
for i in range(0, N):
    x, y, h = [int(x) for x in input().split()]
    list.append((x, y, h))

for X in range(0, 101):
    for Y in range(0, 101):
        b = True
        H = 0
        for Cx, Cy, Ch in list:
            if Ch != 0:
                H = Ch + abs(X - Cx) + abs(Y - Cy)
        for Cx, Cy, Ch in list:
            h = max(H - abs(X - Cx) - abs(Y - Cy), 0)
            if Ch != h:
                b = False
        if b == True:
            print(X, Y, H)
            sys.exit(0)


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):
import sys

N = int(input())

list = []
for i in range(0, N):
    x, y, h = [int(x) for x in input().split()]
    list.append((x, y, h))

for X in range(0, 101):
    for Y in range(0, 101):
        b = True
        H = 0
        for Cx, Cy, Ch in list:
            if Ch != 0:
                H = Ch + abs(X - Cx) + abs(Y - Cy)
        for Cx, Cy, Ch in list:
            h = max(H - abs(X - Cx) - abs(Y - Cy), 0)
            if Ch != h:
                b = False
        if b == True:
            print(X, Y, H)
            sys.exit(0)


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, T = map(int, input().split())

ans  1003
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)

print('TLE' if ans==1003 else ans)


Fixed submission:
import math

N, T = map(int, input().split())

c_list = []
for i in range(N):
    c1, t1=[int(i) for i in input().split()]
    if t1 <= T:
        c_list.append(c1)

if not c_list:
    print('TLE')
else:
    print(min(c_list))
Buggy python submission (verdict: Runtime Error):
import sys

N = int(input())
xyh = []
for _ in range(N):
    x, y, h = map(int, input().split())
    xyh.append(tuple(x, y, h))

for X in range(101):
    for Y in range(101):
        flag = True
        H = 0
        for cx, cy, ch in xyh:
            if ch != 0:
                H = ch + abs(X - cx) + abs(Y - cy)
        for cx, cy, ch in xyh:
            h  max(h - abs(X - cx) - abs(Y - cy), 0)
            if ch != h:
                flag = False

        if flag:
            print(X, Y, H)
            sys.exit(0)


Fixed submission:
import sys

N = int(input())

list = []
for i in range(0, N):
    x, y, h = [int(x) for x in input().split()]
    list.append((x, y, h))

for X in range(0, 101):
    for Y in range(0, 101):
        b = True
        H = 0
        for Cx, Cy, Ch in list:
            if Ch != 0:
                H = Ch + abs(X - Cx) + abs(Y - Cy)
        for Cx, Cy, Ch in list:
            h = max(H - abs(X - Cx) - abs(Y - Cy), 0)
            if Ch != h:
                b = False
        if b == True:
            print(X, Y, H)
            sys.exit(0)
Buggy python submission (verdict: Runtime Error):
n = input()

for i in range(1, 10):
    if n <= i*111:
        print(i*111)
        exit()


Fixed submission:
import re
import sys

n = int(input())

for i in range(n, 1000):
    if re.match('^([0-9])\\1+$', str(i)):
        print(i)
        sys.exit(0)

Buggy python submission (verdict: Runtime Error):
n = input()
zorome = [i*100 + i*10 + i for i in range(1, 10)]

for i in zorome:
    if n <= i:
        print(i)
        exit()


Fixed submission:
import re
import sys

n = int(input())

for i in range(n, 1000):
    if re.match('^([0-9])\\1+$', str(i)):
        print(i)
        sys.exit(0)
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    while b != 0:
        a, b = b, a%b
    return a


def main():
    N, X = map(int, input().split())
    x = [abs(int(i) - X) for i in input().split()] 

    y = x[0]
    for i in range(N):
        if x[i]%y == 0:
            continue
        y = gcd(y, x[i])
    print(y)


if __name__ == '__main__':
    main()

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

if (A*B % 2) == 0:
    print('No')
else:
    print('Yes')