Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
N_str = input()
N_str = N_str.split(" ")
N = [int(s) for s in N_str]

N_before = N.copy()
del N[0]
t = []
for k in range(n):
    cnt = 0
    
    for i, j in zip(N_before[k:-1], N[k:]):
        
        if i >= j:
            cnt = cnt + 1
        else:
            break
    t.append(cnt)
print(max(t))

Fixed submission:
n = int(input())
N_str = input()
N_str = N_str.split(" ")
N = [int(s) for s in N_str]

t = []
cnt = 0  
for i in range(n-1):
    t.append(N[i] - N[i+1])
    
l=[]
cnt = 0
for j in t:

    if j >= 0:
        cnt = cnt + 1
    else:
        l.append(cnt)
        cnt = 0
l.append(cnt)
print(max(l))
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
print(sum(np.arange(n)))

Fixed submission:
import numpy as np
n = int(input())
print(n * (n-1) // 2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
print(sum(np.arange(n)))

Fixed submission:
import numpy as np
n = int(input())
print(n * (n-1) // 2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
sum(np.arange(n))

Fixed submission:
import numpy as np
n = int(input())
print(n * (n-1) // 2)
Buggy python submission (verdict: Runtime Error):
# input
N = int(input())
A = []

#list
for i in range(N):
    n = int(input())
    A.append(n)

#max
for i in range(N):
    A_=A[:i]
    A__=A[i+1:]
    print(max(A_+A__))

Fixed submission:
r = int(input())
print(3*r**2)
Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
def gcd(x, y):
    if x == 0:
        return y
    else:
        return gcd(y % x, x)
def lcm(x,y):
    return x * y // gcd(x,y)
L = lcm(C,D)
b = B - (B // C) - (B // D) + (B // L)
a = (A-1) - ((A-1) // C) - ((A-1) // D) + ((A-1) // L)
print(b - a)

Fixed submission:
S = input()

S1 = S[0]
S2 = S[1]
S3 = S[2]
S4 = S[3]

flg = "Good"

if S1 == S2:
  flg = "Bad"
elif S2 == S3:
  flg = "Bad"
elif S3 == S4:
  flg = "Bad"

print(flg)

Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
#最大公約数
def gcd(x, y):
    if x == 0:
        return y
    else:
        return gcd(y % x, x)
#最小公倍数
def lcm(x,y):
    return x * y // gcd(x,y)
L = lcm(C,D)
b = B - (B // C) - (B // D) + (B // L)
a = (A-1) - ((A-1) // C) - ((A-1) // D) + ((A-1) // L)
print(b - a)

Fixed submission:
S = input()

S1 = S[0]
S2 = S[1]
S3 = S[2]
S4 = S[3]

flg = "Good"

if S1 == S2:
  flg = "Bad"
elif S2 == S3:
  flg = "Bad"
elif S3 == S4:
  flg = "Bad"

print(flg)

Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int, input().split())
cnt = 0
for i in range(A, B+1):
    if not i % C == 0:
        if not i % D == 0:
            cnt = cnt + 1
print(cnt)

Fixed submission:
S = input()

S1 = S[0]
S2 = S[1]
S3 = S[2]
S4 = S[3]

flg = "Good"

if S1 == S2:
  flg = "Bad"
elif S2 == S3:
  flg = "Bad"
elif S3 == S4:
  flg = "Bad"

print(flg)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())

for _ in range(k):
	if a:
		a -= 1
	elif b:
		b -= 1
		
print(a, b)

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

if a >= k:
	a = a - k
elif a + b >= k:
	b = b - (k - a)
	a = 0
else:
	a = 0
	b = 0
		
print(a, b)
Buggy python submission (verdict: Runtime Error):
from math import gcd
A, B = map(int, input().split())
print(int((A * B)/gcd(A, B)))

Fixed submission:
from fractions import gcd
A, B = map(int, input().split())
print(int((A * B)/gcd(A, B)))
Buggy python submission (verdict: Time Limit Exceeded):
N, u, v = map(int, input().split())
points = [list(map(int, input().split())) for i in range(N - 1)]
tree = [[] for i in range(N + 1)]
for a, b in points:
	tree[a].append(b)
	tree[b].append(a)

def bfs(node):
	sta = [node]
	dis = [-1] * (N + 1)
	dis[node] = 0
	while sta:
		no = sta.pop(0)
		tempD = dis[no] + 1
		for tempN in tree[no]:
			if dis[tempN] < 0:
				dis[tempN] = tempD
				sta.append(tempN)
	else:
		return dis

disU = bfs(u)
disV = bfs(v)
ans = 0

for u_, v_ in zip(disU[1:], disV[1:]):
	if u_ < v_:
			ans = max(ans, v_)
else:
	print(ans - 1)

Fixed submission:
N, u, v = map(int, input().split())
tree = [[] for i in range(N + 1)]
for _ in range(N - 1):
	a, b = map(int, input().split())
	tree[a].append(b)
	tree[b].append(a)

def dfs(node):
	sta = [node]
	dis = [-1] * (N + 1)
	dis[node] = 0
	while sta:
		no = sta.pop()
		tempD = dis[no] + 1
		for tempN in tree[no]:
			if dis[tempN] < 0:
				dis[tempN] = tempD
				sta.append(tempN)
	else:
		return dis

disU = dfs(u)
disV = dfs(v)
ans = 0

for u_, v_ in zip(disU[1:], disV[1:]):
	if u_ < v_:
			ans = max(ans, v_)
else:
	print(ans - 1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))
modNum = 10**9 + 7
sum = 0
for d in range(60):
	n1 = 0
	for A in As:
		if (A >> d) & 1 == 1:
			n1 += 1
	sum += (2 ** d) * n1 * (N - n1)
print(sum % modNum)

Fixed submission:
import numpy as np
N = int(input())
As = np.array(list(map(int, input().split())))
modNum = 10**9 + 7
sum = 0
for d in range(60):
	n1 = np.count_nonzero((As >> d) & 1 == 1)
	sum += (2 ** d) * n1 * (N - n1)
print(sum % modNum)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))
modNum = 10**9 + 7
sum = 0
for d in range(60):
	n0 = 0
	n1 = 0
	for A in As:
		if (A >> d) & 1 == 1:
			n1 += 1
		else:
			n0 += 1
	sum += (1 << d) * n1 * n0
print(sum % modNum)

Fixed submission:
import numpy as np
N = int(input())
As = np.array(list(map(int, input().split())))
modNum = 10**9 + 7
sum = 0
for d in range(60):
	n1 = np.count_nonzero((As >> d) & 1 == 1)
	sum += (2 ** d) * n1 * (N - n1)
print(sum % modNum)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))
modNum = 10**9 + 7
sum = 0
for i in range(N-1):
	for j in range(i+1, N):
		sum += As[i] ^ As[j]
print(sum % modNum)

Fixed submission:
import numpy as np
N = int(input())
As = np.array(list(map(int, input().split())))
modNum = 10**9 + 7
sum = 0
for d in range(60):
	n1 = np.count_nonzero((As >> d) & 1 == 1)
	sum += (2 ** d) * n1 * (N - n1)
print(sum % modNum)
Buggy python submission (verdict: Runtime Error):
input()
a = [int(x) for x in input().split()]
    
for i in a:
  B = i%2
  if B==0:
    if i%3 == i%5 and i>=6:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Fixed submission:
a,b,c = [int(x) for x in input().split()]
if (a == b and b!=c) or (a==c and a!=b) or (b==c and b!=a):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
b = []
for i in range(N):
  a = int(input())
  b.append(a)
    
for i in b:
  B = i%2
  if B==0:
    if i%3 == i%5:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Fixed submission:
a,b,c = [int(x) for x in input().split()]
if (a == b and b!=c) or (a==c and a!=b) or (b==c and b!=a):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input()) #1行目のNを取得する
A = [int(input()) for i in range(N)] #複数行の数値の入力を取得
    
for i in A:
  B = i%2
  if B==0:
    if i%3 == i%5:
      print("APPROVED")
    else:
      print("DENIED")
  else:
    print("DENIED")

Fixed submission:
a,b,c = [int(x) for x in input().split()]
if (a == b and b!=c) or (a==c and a!=b) or (b==c and b!=a):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())  # 数値入�?
str = list(input())  # 一�?字ずつ格�?
ans = float("Inf")

for i in range(0, n+1):
    tmp = str[:i].count("#") + str[i:].count(".")

    if tmp < ans:
        ans = tmp

print(ans)


Fixed submission:
n = int(input())  # 数値入�?
str = list(input())  # 一�?字ずつ格�?
dotto = str.count(".")
ans = dotto
syapu = 0

for i in range(0, n):
    if str[i] == ".":
        dotto -= 1
    else:
        syapu += 1

    if dotto + syapu < ans:
        ans = dotto + syapu

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
str = list(input())
check = 0   #
ans = 0  # 取り除いた数
odd = 0

while True:
    check = 0

    if odd == 0:
        last = str[0]
        for j in range(len(str) - 1):
            if last != str[j + 1]:
                str.pop(j)
                str.pop(j)
                check = 1
                ans += 2
                break
            last = str[j + 1]
        odd = 1
    else:
        last = str[len(str)-1]
        for j in reversed(range(len(str) - 1)):
            if last != str[j]:
                str.pop(j)
                str.pop(j)
                check = 1
                ans += 2
                break
            last = str[j]
        odd = 0

    if check == 0:
        break
    if str == []:
        break

print(ans)


Fixed submission:
str = list(input())
one = str.count("1")
zero = str.count("0")

print(min(one, zero)*2)

Buggy python submission (verdict: Runtime Error):
str = list(input())
last = str[0]
check = 0
ans = 0

while True:
    check = 0
    last = str[0]
    for j in range(len(str) - 1):
        if j >= len(str):
            break

        if last != str[j + 1 - check]:
            str.pop(j-check)
            str.pop(j-check)
            check += 1
            ans += 2

        if str == []:
            break
        last = str[j + 1 - check]

    if check == 0:
        break
    if str == []:
        break

print(ans)


Fixed submission:
str = list(input())
one = str.count("1")
zero = str.count("0")

print(min(one, zero)*2)

Buggy python submission (verdict: Time Limit Exceeded):
str = list(input())
last = str[0]
check = 0
ans = 0
while True:
    check = 0
    last = str[0]
    for j in range(len(str) - 1):
        if last != str[j + 1]:
            str.pop(j)
            str.pop(j)
            check = 1
            ans += 2
            break
        last = str[j+1]
    if check == 0:
        break
    if str == []:
        break

print(ans)


Fixed submission:
str = list(input())
one = str.count("1")
zero = str.count("0")

print(min(one, zero)*2)
Buggy python submission (verdict: Runtime Error):
import math

N, A, B, C = map(int, input().split())  # 複数数値入力
L = [0] * N
for i in range(N):
    L[i] = int(input())


def dfs(depth, a, b, c):    # 深さは何本目の竹まで場合分けしたかを示す  a,b,cにはA,B,Cに割り当てられている竹の長さの和が入っている　戻り値はMP
    if depth == N:
        # ABCのどれかが1本も割り当てられていない場合はだめなのでINFを返す
        return abs(a-A)+abs(b-B)+abs(c-C) - 30 if min(a, b, c) > 0 else math.inf

    ret0 = dfs(depth + 1, a, b, c)  # depth本目の竹を使わない
    # depth本目の竹をAを作るのに使用する    コストを足して、長さには使用する竹の長さを足してやる
    ret1 = dfs(depth + 1, a + L[depth], b, c) + 10
    ret2 = dfs(depth + 1, a, b + L[depth], c) + 10  # depth本目の竹をBを作るのに使用する
    ret3 = dfs(depth + 1, a, b, c + L[depth]) + 10  # depth本目の竹をCを作るのに使用する

    return min(ret0, ret1, ret2, ret3)  # 一番小さいMPを返す


print(dfs(0, 0, 0, 0))


Fixed submission:
N, A, B, C = map(int, input().split())  # 複数数値入力
L = [0] * N
for i in range(N):
    L[i] = int(input())


def dfs(depth, a, b, c):    # 深さは何本目の竹まで場合分けしたかを示す  a,b,cにはA,B,Cに割り当てられている竹の長さの和が入っている　戻り値はMP
    if depth == N:
        # ABCのどれかが1本も割り当てられていない場合はだめなのでINFを返す
        return abs(a-A)+abs(b-B)+abs(c-C) - 30 if min(a, b, c) > 0 else 1000000000

    ret0 = dfs(depth + 1, a, b, c)  # depth本目の竹を使わない
    # depth本目の竹をAを作るのに使用する    コストを足して、長さには使用する竹の長さを足してやる
    ret1 = dfs(depth + 1, a + L[depth], b, c) + 10
    ret2 = dfs(depth + 1, a, b + L[depth], c) + 10  # depth本目の竹をBを作るのに使用する
    ret3 = dfs(depth + 1, a, b, c + L[depth]) + 10  # depth本目の竹をCを作るのに使用する

    return min(ret0, ret1, ret2, ret3)  # 一番小さいMPを返す


print(dfs(0, 0, 0, 0))

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

N, A, B, C = map(int, input().split())  # 複数数値入力
L = [0] * N
for i in range(N):
    L[i] = int(input())


def dfs(depth, a, b, c):    # 深さは何本目の竹まで場合分けしたかを示す  a,b,cにはA,B,Cに割り当てられている竹の長さの和が入っている　戻り値はMP
    if depth == N:
        # ABCのどれかが1本も割り当てられていない場合はだめなのでINFを返す
        return abs(a-A)+abs(b-B)+abs(c-C) - 30 if min(a, b, c) > 0 else math.inf

    ret0 = dfs(depth + 1, a, b, c)  # depth本目の竹を使わない
    # depth本目の竹をAを作るのに使用する    コストを足して、長さには使用する竹の長さを足してやる
    ret1 = dfs(depth + 1, a + L[depth], b, c) + 10
    ret2 = dfs(depth + 1, a, b + L[depth], c) + 10  # depth本目の竹をBを作るのに使用する
    ret3 = dfs(depth + 1, a, b, c + L[depth]) + 10  # depth本目の竹をCを作るのに使用する

    return min(ret0, ret1, ret2, ret3)  # 一番小さいMPを返す


print(dfs(0, 0, 0, 0))


Fixed submission:
N, A, B, C = map(int, input().split())  # 複数数値入力
L = [0] * N
for i in range(N):
    L[i] = int(input())


def dfs(depth, a, b, c):    # 深さは何本目の竹まで場合分けしたかを示す  a,b,cにはA,B,Cに割り当てられている竹の長さの和が入っている　戻り値はMP
    if depth == N:
        # ABCのどれかが1本も割り当てられていない場合はだめなのでINFを返す
        return abs(a-A)+abs(b-B)+abs(c-C) - 30 if min(a, b, c) > 0 else 1000000000

    ret0 = dfs(depth + 1, a, b, c)  # depth本目の竹を使わない
    # depth本目の竹をAを作るのに使用する    コストを足して、長さには使用する竹の長さを足してやる
    ret1 = dfs(depth + 1, a + L[depth], b, c) + 10
    ret2 = dfs(depth + 1, a, b + L[depth], c) + 10  # depth本目の竹をBを作るのに使用する
    ret3 = dfs(depth + 1, a, b, c + L[depth]) + 10  # depth本目の竹をCを作るのに使用する

    return min(ret0, ret1, ret2, ret3)  # 一番小さいMPを返す


print(dfs(0, 0, 0, 0))
Buggy python submission (verdict: Runtime Error):
import functools
import math

n=int(input())  #数値入力
a=list(map(int, input().split()))  #リスト入力（数値)

gcd = functools.reduce(math.gcd, a)
print(gcd)

Fixed submission:
def main():
    n=int(input())  #数値入力
    a=list(map(int, input().split()))  #リスト入力（数値)
    num = a[0]

    for i in range(n-1):
        num = gcd(num, a[i+1])
    print(num)

# 最大公約数
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

main()
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [float("inf") for i in range(n+k+10)]
dp[0] = 0

for i in range(n-1):
    for j in range(1,k+1):
        if i+j >= n:
            continue
        dp[i+j] = min(dp[i+j], dp[i] +abs(h[i]-h[i+j]))

print(dp[n-1])

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

dp = [float("inf") for i in range(n+k+10)]
dp[0] = 0

for i in range(n-1):
    for j in range(1,k+1):
        if i+j >= n:
            continue
        dp[i+j] = min(dp[i+j], dp[i] +abs(h[i]-h[i+j]))

print(dp[n-1])
Buggy python submission (verdict: Runtime Error):
import math

str = list(input())  # 一文字ずつ格納
ans = math.inf

for i in range(len(str) - 1):
    sa = abs(int(str[i - 1]) * 100 + int(str[i]) * 10 + int(str[i + 1]) - 753)

    ans = min(ans, sa)

print(ans)


Fixed submission:
str = list(input())  # 一文字ずつ格納
ans = 1000

for i in range(len(str) - 2):
    sa = abs(int(str[i]) * 100 + int(str[i+1]) * 10 + int(str[i + 2]) - 753)
    ans = min(ans, sa)

print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
if a == 1:
    print("Hello World")
else:
    c, b = map(int, input().split())  # 複数数値入力
    print(c+b)


Fixed submission:
a = int(input())

if a == 1:
    print("Hello World")
else:
    b = int(input())
    c = int(input())
    print(c+b)
Buggy python submission (verdict: Runtime Error):
HP=int(input())

print(Caracal(HP))

def Caracal(x):
  if x>1:
    ans=1+Caracal(x//2)*2
  elif x==1:
    ans=1
  return ans


Fixed submission:
HP=int(input())

def Caracal(x):
  if x>1:
    ans=1+Caracal(x//2)*2
  elif x==1:
    ans=1
  return ans

print(Caracal(HP))

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

print(Caracal(HP))

def Caracal(x):
  if x>1:
    ans=1+Caracal(x//2)*2
  elif x==1:
    ans=1
  print(x,ans)
  return ans


Fixed submission:
HP=int(input())

def Caracal(x):
  if x>1:
    ans=1+Caracal(x//2)*2
  elif x==1:
    ans=1
  return ans

print(Caracal(HP))
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input.split())

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

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

if A == B == C:
  print("No")
elif A !=B and A != C and B != C:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
          count += 1:
            

if count:
    print("DENIED")
else:
    print("APPROVED")

Fixed submission:
import numpy as np
 
N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
            count += 1

if count:
    print("DENIED")
else:
    print("APPROVED")

Buggy python submission (verdict: Runtime Error):
N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 == 0 or a[i]%5== 0:
            count += 1

if count:
    print("DENIED")
else:
    print("APPROVED")

Fixed submission:
import numpy as np
 
N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
            count += 1

if count:
    print("DENIED")
else:
    print("APPROVED")

Buggy python submission (verdict: Runtime Error):
import numpy as np
 
N = int(input())
l = map(int,input().split())
a = np.array(l)
count = 0
 
for i in range(len(a)):
    if a[i]%6 == 0 or a[i]%10 == 0:
        count += 1
    
if count:
    print("APPROVE")
else:
    print("DENIED")

Fixed submission:
import numpy as np
 
N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
            count += 1

if count:
    print("DENIED")
else:
    print("APPROVED")

Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
l = map(int,input().split())
a = np.array(l)
count = 0

for i in range(len(a)):
  if a[i]%6 = 0 or a[i]%10 == 0:
    count += 1

if count:
  print("APPROVE")
else:
  print("DENIED")

Fixed submission:
import numpy as np
 
N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
            count += 1

if count:
    print("DENIED")
else:
    print("APPROVED")

Buggy python submission (verdict: Runtime Error):
N = int(input())
l = map(int,input().split())
a = np.array(l)
count = 0

for i in range(len(a)):
  if a[i]%6 = 0 or a[i]%10 == 0:
    count += 1

if count:
  print("APPROVE")
else:
  print("DENIED")

Fixed submission:
import numpy as np
 
N = int(input())
l = list(map(int,input().split()))
a = np.array(l)
count = 0

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
            count += 1

if count:
    print("DENIED")
else:
    print("APPROVED")
Buggy python submission (verdict: Runtime Error):
N,L=(map(int,input().split()))

Nazi=[]

for i in range(N+1):
    azi=L+i-1
    Nazi.append(azi)
del Nazi[0]

sum=0
if L>0:
    del Nazi[0]
    print(sum(Nazi))
else:
    for i in Nazi:
       sum+=i
    sum=(sum-Nazi[-1])
    print(sum)

Fixed submission:
N,L=input().split()


ApplesTaste=[]
for i in range(int(N)):
    taste=int(L)+i
    ApplesTaste.append(taste)


hu=0
zero=0
for i in ApplesTaste:
    
    if i is 0:
        zero+=1
    if i < 0:
        hu+=1

#0がある
if zero is 1:
    point=ApplesTaste.index(0)
    del ApplesTaste[point]
    print(sum(ApplesTaste))

#0がなく全部負
elif hu > 0 and zero is 0:
    point=len(ApplesTaste)-1
    
    del ApplesTaste[point]
    print (sum(ApplesTaste))

else:
    del ApplesTaste[0]
    print(sum(ApplesTaste))
Buggy python submission (verdict: Runtime Error):
r = int(intput())
print(3*r*r)

Fixed submission:
r = int(input())
print(3*r*r)
Buggy python submission (verdict: Runtime Error):
n, d = map(int, input().split())
i = (n // 2*r) + 1
print(i)

Fixed submission:
n, d = map(int, input().split())
if n % (2*d + 1) == 0:
  print(n // (2*d + 1))
else:
  print(n // (2*d + 1) + 1)
Buggy python submission (verdict: Runtime Error):
S = list(input())
count = list(S.count(i) for i in set(S))
if count[0] == count[1] and count[0] == 2:
    print('Yes')
else:
    print('No')

Fixed submission:
S = list(input())
count = list(S.count(i) for i in set(S))
if len(count) == 2 and count[0] == count[1] and count[0] == 2:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
S = list(input())
ans = 'Yes'
count = list(S.count(i) for i in set(S))
if count[0] == count[1] and count[0] == 2:
    print('Yes')
else:
    print('No')

Fixed submission:
S = list(input())
count = list(S.count(i) for i in set(S))
if len(count) == 2 and count[0] == count[1] and count[0] == 2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N, i = map(int, input().split())
print(N - i +　1)

Fixed submission:
N, i = map(int, input().split())
print(N - i + 1)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [list(input()) for i in range(N)]
B = [list(input()) for i in range(M)]
ans = 'No'
for i in range(N - M +1):
    for j in range(N - M +1):
        count = 0
        for row in range(M):
            for col in range(M):
                if B[row][col] == A[i + row][j + col]:
                    count += 1
        if count == M * M:
            ans = 'Yes'

print(ans)

Fixed submission:
a, b = (int(x) for x in input().split())
if a == b:
  print('Draw')
elif a == 1:
  print('Alice')
elif b == 1:
  print('Bob')
elif a > b:
  print('Alice')
elif a < b:
  print('Bob')
Buggy python submission (verdict: Runtime Error):
H, M = map(int, input().split())
src_image = [list(input().split() for i in range(H))]
for i in range(H):
    print(*src_image[i])
    print(*src_image[i])

Fixed submission:
H, M = map(int, input().split())
src_image = [list(input().split()) for i in range(H)]
for i in range(H):
    print(*src_image[i])
    print(*src_image[i])
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())
count1 = 0
count2 = 0
for i in range(0, a, x):
    count1 += 1

for i in range(0, b + 1, x):
    count2 += 1

print(count2 - count1)

Fixed submission:
a, b, x = map(int, input().split())
def func(n):
  if n >= 0:
    return n // x + 1
  elif n == -1:
    return 0
print(func(b) - func(a-1))
Buggy python submission (verdict: Runtime Error):
n, l = (int(x) for x in input().split())
s_list = []
s = ''
for i in range(n):
  s_list.append(input())
for i in range(l):
  s += s_list.pop(s_list.index(min(x for x in s_list)))
print(s)  

Fixed submission:
n, l = (int(x) for x in input().split())
s_list = []
s = ''
for i in range(n):
  s_list.append(input())
for i in range(n):
  s += s_list.pop(s_list.index(min(x for x in s_list)))
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
str_list = []
for i in range(N):
  str_list.append(input())
str_set = sorted(list(set(str_list)))
cnt = [0] * len(str_set)
for i, str in enumerate(str_set):
  cnt[i] = str_list.count(str)

max_cnt = max(cnt)
for i in range(len(cnt)):
  if cnt[i]==max_cnt:
    print(str_set[i])

Fixed submission:
from collections import Counter

N = int(input())
cnt = Counter()
for i in range(N):
  cnt[input()] += 1

mc = cnt.most_common(1)[0][1]
ms = []
for kw, count in cnt.most_common():
  if(count<mc):
    break
  ms.append(kw)
  
ms.sort()
for s in ms:
  print(s)