Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S = input()
flag = 0
for i in range(N):
	if i%2 == 0 and (S[i] not in ['R', 'U', 'D']):
		flag = 1
	if i%2 == 1 and (S[i] not in ['L', 'U', 'D']):
		flag = 1
if flag == 0:
	print('Yes')
else:
	print('No')

Fixed submission:
S = input()
flag = 0
for i in range(len(S)):
	if i%2 == 0 and (S[i] not in ['R', 'U', 'D']):
		flag = 1
	if i%2 == 1 and (S[i] not in ['L', 'U', 'D']):
		flag = 1
if flag == 0:
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
S = input()
flag = 0
for i in range(N):
	if i%2 = 0 and (S[i] not in ['R', 'U', 'D']):
		flag = 1
	if i%2 = 1 and (S[i] not in ['L', 'U', 'D']):
		flag = 1
if flag == 0:
	print('Yes')
else:
	print('No')

Fixed submission:
S = input()
flag = 0
for i in range(len(S)):
	if i%2 == 0 and (S[i] not in ['R', 'U', 'D']):
		flag = 1
	if i%2 == 1 and (S[i] not in ['L', 'U', 'D']):
		flag = 1
if flag == 0:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
B = list(map(int, input().split()))

ans = 0
for i in range(N):
	ans += min([A[i], A[i+1]])

ans += A[N-1]

print(ans)


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

ans = B[0]

for i in range(N-2):
	ans += min([B[i], B[i+1]])

ans += B[N-2]

print(ans)

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

ans = 0
for i in range(N):
	ans += min(A[i], A[i+1])

ans += A[N-1]

print(ans)

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

ans = B[0]

for i in range(N-2):
	ans += min([B[i], B[i+1]])

ans += B[N-2]

print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
if A == B and C == D and A != C:
  print('Yes')
elif A == C and B == D and A != B:
  print('Yes')
elif A == D and B == C and A != B:
  print('Yes')
else:
  print('No')

Fixed submission:
S = input()
A = S[0]
B = S[1]
C = S[2]
D = S[3]
if A == B and C == D and A != C:
  print('Yes')
elif A == C and B == D and A != B:
  print('Yes')
elif A == D and B == C and A != B:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
W = map(int, input().split())
 
l = [0] * N
r = [0] * N
 
for i in range(N):
  if i == 0:
    r[i] = W[0]
    l[i] = W[N-1]
  else:
    r[i] = r[i-1] + W[i]
    l[i] = l[i-1] + W[N-i-1]
 
ans = 100000
for i in range(N-1):
  ans = min([abs(r[i] - l[N-i-2]), ans])
print(ans)

Fixed submission:
N = int(input())
W = list(map(int, input().split()))
 
l = [0] * N
r = [0] * N
 
for i in range(N):
  if i == 0:
    r[i] = W[0]
    l[i] = W[N-1]
  else:
    r[i] = r[i-1] + W[i]
    l[i] = l[i-1] + W[N-i-1]
 
ans = 100000
for i in range(N-1):
  ans = min([abs(r[i] - l[N-i-2]), ans])
print(ans)

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

l = [0] * N
r = [0] * N

for i in range(N):
  if i == 0:
    r[i] = W[0]
    l[i] = W[N-1]
  else:
    r[i] = r[i-1] + W[i]
    l[i] = l[i-1] + W[N-i-1]

ans = 100000
for i in range(N):
  ans = min([abs(r[i] - l[N-i-1]), ans])
print(ans)

Fixed submission:
N = int(input())
W = list(map(int, input().split()))
 
l = [0] * N
r = [0] * N
 
for i in range(N):
  if i == 0:
    r[i] = W[0]
    l[i] = W[N-1]
  else:
    r[i] = r[i-1] + W[i]
    l[i] = l[i-1] + W[N-i-1]
 
ans = 100000
for i in range(N-1):
  ans = min([abs(r[i] - l[N-i-2]), ans])
print(ans)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()
if S[K-1] == 'A':
  S[K-1] = 'a'
elif S[K-1] == 'B':
  S[K-1] = 'b'
else:
  S[K-1] = 'c'
print(S)

Fixed submission:
N, K = map(int, input().split())
S = input()
print(S[:K-1] + S[K-1].lower() + S[K:])

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()
if S[K-1] == 'A':
  S[K-1] = 'a'
elif S[K-1] == 'B':
  S[K-1] = 'b'
else:
  S[K-1] = 'c'
print(S)

Fixed submission:
N, K = map(int, input().split())
S = input()
print(S[:K-1] + S[K-1].lower() + S[K:])

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()
if S[K-1] == 'A':
  S[K-1] = 'a'
elif S [K-1] == 'B':
  S[K-1] = 'b'
else:
  S[K-1] = 'c'
print(S)

Fixed submission:
N, K = map(int, input().split())
S = input()
print(S[:K-1] + S[K-1].lower() + S[K:])
Buggy python submission (verdict: Time Limit Exceeded):
S = input()

s1 = ''
s2 = ''
for i in range(len(S)):
	if i % 2 == 0:
		s1 += '0'
		s2 += '1'
	else:
		s1 += '1'
		s2 += '0'
dif1 = 0
dif2 = 0
for i in range(len(S)):
	if S[i] != s1[i]:
		dif1 += 1
	if S[i] != s2[i]:
		dif2 += 1

print(min([dif1, dif2]))

Fixed submission:
S = input()

dif1 = 0
dif2 = 0

for i in range(len(S)):
	if i%2 == 0 and S[i] == '0':
		dif1 += 1
	if i%2 == 1 and S[i] == '1':
		dif1 += 1
	if i%2 == 0 and S[i] == '1':
		dif2 += 1
	if i%2 == 1 and S[i] == '0':
		dif2 += 1

print(min([dif1, dif2]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a, b = map(int, input().split())
for i in range(a, b + 1):
  if i % n == 0:
	print("OK")
    quit()
print("NG")

Fixed submission:
n = int(input())
a, b = map(int, input().split())
for i in range(a, b + 1):
  if i % n == 0:
    print("OK")
    quit()
print("NG")
Buggy python submission (verdict: Runtime Error):
n = list(map(int,input()))[::-1]
n.append(0)
for i in range(len(n)):
	if n[i] >= 6 or (n[i] == 5 and n[i+1] >= 5):
    	n[i] = 10 - n[i]
        n[i+1] += 1
print(sum(n))

Fixed submission:
n = list(map(int,input()))[::-1]
n.append(0)
for i in range(len(n)):
    if n[i] >= 6 or (n[i] == 5 and n[i+1] >= 5):
        n[i] = 10 - n[i]
        n[i+1] += 1
print(sum(n))
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n == "SAT":
    print(1)
elif n == "MON":
    print(6)
elif n == "TUE":
    print(5)
elif n == "WED":
    print(4)
elif n == "THU":
    print(3)
elif n == "FRI":
    print(2)
else:
    print(7)

Fixed submission:
n = input()
if n == "SAT":
    print(1)
elif n == "MON":
    print(6)
elif n == "TUE":
    print(5)
elif n == "WED":
    print(4)
elif n == "THU":
    print(3)
elif n == "FRI":
    print(2)
else:
    print(7)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()
if s >= 3200:
  print(s)
else:
  print("red")

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Runtime Error):
N, X, T = map(int,input().split())

if ( N % x ) == 0:
    print(( N // X ) * T )
else:
    print(( N // X + 1 ) * T )

Fixed submission:
N, X, T = map(int,input().split())

A = N % X

if ( A ) == 0:
    print(( N // X ) * T )
elif ( N % X ) != 0:
    print(( N // X + 1 ) * T )

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

if ( N % x ) == 0:
    print(( N // X ) * T )
elif ( N % x ) != 0:
    print(( N // X + 1 ) * T )

Fixed submission:
N, X, T = map(int,input().split())

A = N % X

if ( A ) == 0:
    print(( N // X ) * T )
elif ( N % X ) != 0:
    print(( N // X + 1 ) * T )

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

if ( N % x )== 0:
    print(( N // X ) * T )
else:
    print(( N // X + 1 ) * T )

Fixed submission:
N, X, T = map(int,input().split())

A = N % X

if ( A ) == 0:
    print(( N // X ) * T )
elif ( N % X ) != 0:
    print(( N // X + 1 ) * T )

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

if N % x == 0:
    print(( N // X ) * T )
else:
    print(( N // X + 1 ) * T )

Fixed submission:
N, X, T = map(int,input().split())

A = N % X

if ( A ) == 0:
    print(( N // X ) * T )
elif ( N % X ) != 0:
    print(( N // X + 1 ) * T )

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

if N % x == 0
    print(( N // X ) * T )
else:
    print(( N // X + 1 ) * T )

Fixed submission:
N, X, T = map(int,input().split())

A = N % X

if ( A ) == 0:
    print(( N // X ) * T )
elif ( N % X ) != 0:
    print(( N // X + 1 ) * T )

Buggy python submission (verdict: Runtime Error):
print(( N // X + 1 ) * T )

Fixed submission:
N, X, T = map(int,input().split())

A = N % X

if ( A ) == 0:
    print(( N // X ) * T )
elif ( N % X ) != 0:
    print(( N // X + 1 ) * T )

Buggy python submission (verdict: Runtime Error):
print(( N // X + 1 ) * T )


Fixed submission:
N, X, T = map(int,input().split())

A = N % X

if ( A ) == 0:
    print(( N // X ) * T )
elif ( N % X ) != 0:
    print(( N // X + 1 ) * T )
Buggy python submission (verdict: Runtime Error):
if S == 'SUN':
    print(7)
elif S == 'MON':
    print(1)
elif S == 'TUE':
    print(2)
elif S == 'WED':
    print(3)
elif S == 'THU':
    print(4)
elif S == 'FRI':
    print(5)
elif S == 'SAT':
    print(6)


Fixed submission:
S = input()

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)
Buggy python submission (verdict: Runtime Error):
N = input()

if N >= 1000:
    print( 'ABD' )

else :
    print( 'ABC' )


Fixed submission:
N = int(input())

if N >= 1000:
    print( 'ABD' )

else :
    print( 'ABC' )
Buggy python submission (verdict: Runtime Error):

N = int(input())

if N[0] == N[1] and N[1] == N[2] :
    print('Yes')

elif N[1] == N[2] and N[2] == N[3]:
    print('Yes')

else:
    print('No')

Fixed submission:

N = str(input())

if N[0] == N[1] and N[1] == N[2] :
    print('Yes')

elif N[1] == N[2] and N[2] == N[3]:
    print('Yes')

else:
    print('No')
Buggy python submission (verdict: Runtime Error):

C =str(input())


if C[0] == C[5] and C[1] == C[4] and C[2] == C[3]:
    print('Yes')

else:
    print('No')


Fixed submission:

C1 =str(input())
C2 =str(input())

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
    print('YES')

else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
# 等差数列

N = int(input())

# 1+2+3+4+...+(N-2)+(N-1)+N
# N+(N-1)+(N-2)+...+4+3+2+1
# 上と下を足し算して、２で割る

a = N+1
b = N

# print( a * b / 2 )

# TypeError: can only concatenate str (not "int")
# Nという文字と数字を連結できない??
print(math.floor(a * b / 2 )

Fixed submission:
N = int(input())

# 1+2+3+4+...+(N-2)+(N-1)+N
# N+(N-1)+(N-2)+...+4+3+2+1
# 上と下を足し算して、２で割る

a = N+1
b = N

print(int( a * b * 0.5 ))
Buggy python submission (verdict: Runtime Error):
n = int(input())
_a = list(map(int, input().split()))
a = {}
for i in range(n):
    if _a[i] in a:
        a[_a[i]] += 1
    else:
        a[_a[i]] = 1
q = int(input())
for i in range(q):
    b, c = map(int, input().split())
    if b in a:
        if c not in a:
            a[c] = 0
        tmp = a[b]
        a[c] += tmp
        a[b] = 0
        sum_ = 0
        for k in a:
            sum_ += k * a[k]
    print(sum_)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
q = int(input())
total = sum(a)
dct = {}
for i in range(n):
    if a[i] in dct:
        dct[a[i]] += 1
    else:
        dct[a[i]] = 1

for i in range(q):
    b, c = map(int, input().split())
    if b not in dct: dct[b] = 0
    if c not in dct: dct[c] = 0
    total += dct[b] * (c - b)
    print(total)
    
    dct[c] += dct[b]
    dct[b] = 0
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

ans = a[0]
for i in range(1, len(a)):
    ans *= a[i]

if ans > 10**18:
    print("-1")
else:
    print(ans)

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

if a[0] == 0:
    print(0)
    exit()
else:
    ans = a[0]
    for i in range(1, len(a)):
        ans *= a[i]
        if ans > 10**18:
            print("-1")
            exit()
    
    
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, k = map(int, input().split())

if k < a:
    print(k)
    exit()

k -= (a+b)
if k <= 0:
    print(a)
    exit()
else:
    ans = a

for i in range(k):
    ans -= 1
print(ans)

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

if k < a:
    print(k)
    exit()

k -= (a+b)
if k <= 0:
    print(a)
    exit()
else:
    ans = a

print(ans - k)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

snk = [False] * n

for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    
    for i+1 in a:
        snk[i] = True
 
print(snk.count(False))

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


snk = [False]*n

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

print(snk.count(False))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

ans = 0
input_list = []
for i in range(n):
    s = input()
    if s in input_list: continue
    input_list.append(s)
    ans += 1
print(ans)

Fixed submission:
n = int(input())

ans = 0
input_list = []
for i in range(n): input_list.append(input())
for i in set(input_list):
    ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    print(a.count(i+1))

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

a.sort()
tn = 1
cnt = 0
suffix = 0
for i in range(n):
    for j in range(suffix, n-1):
        if a[j] == tn:
            cnt += 1
            suffix = j+1
        else:
            break
    print(cnt)
    cnt = 0
    tn += 1

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

a.sort()
tn = 1
cnt = 0
suffix = 0
for i in range(n):
    
    for j in range(suffix, n-1):
        if a[j] == tn:
            cnt += 1
            suffix = j
    print(cnt)
    cnt = 0
    tn += 1

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

a.sort()
tn = 1
cnt = 0
suffix = 0
for i in range(n):
    for j in range(suffix, n-1):
        if a[j] == tn:
            cnt += 1
            suffix = j+1
        else:
            break
    print(cnt)
    cnt = 0
    tn += 1

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

a.sort()
tn = 1
cnt = 0
suffix = 0
for i in range(n):
    
    for j in range(suffix, n-1):
        if a[j] == tn:
            cnt += 1
            suffix = j
    print(cnt)
    cnt = 0
    tn += 1

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

a.sort()
tn = 1
cnt = 0
suffix = 0
for i in range(n):
    for j in range(suffix, n-1):
        if a[j] == tn:
            cnt += 1
            suffix = j+1
        else:
            break
    print(cnt)
    cnt = 0
    tn += 1

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

a.sort()
tn = 1
cnt = 0
for i in range(n):
    
    for j in a:
        if j == tn: cnt += 1
    print(cnt)
    cnt = 0
    tn += 1
        

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

a.sort()
tn = 1
cnt = 0
suffix = 0
for i in range(n):
    for j in range(suffix, n-1):
        if a[j] == tn:
            cnt += 1
            suffix = j+1
        else:
            break
    print(cnt)
    cnt = 0
    tn += 1
Buggy python submission (verdict: Runtime Error):
import math
n, k = map(int, input().split())

if k == 1:
    print(0)
    exit()

gcd = math.gcd(n, k)
print(gcd)

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

if k == 1:
    print(0)
    exit()
    
if n > k:
    n = n%k
    print(min(n, abs(n-k)))
else:
    print(min(n, abs(n-k)))

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

if k == 1:
    print(0)
    exit()

low = 10**19
while True:
    tmp = abs(n-k)
    if tmp < low:
        low = tmp
        n = tmp
    else: break

print(low)

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

if k == 1:
    print(0)
    exit()
    
if n > k:
    n = n%k
    print(min(n, abs(n-k)))
else:
    print(min(n, abs(n-k)))
Buggy python submission (verdict: Runtime Error):
k, n = map(int, input().split())
a = list(map(int, input().split()))

# 時計回り
r_ans = 10**9
if a[0] + a[n-1] >= k:
    r_ans = a[n-1] - a[0]
    # print(a[n-1] - a[0])

# 反時計回り
else:
    max_n = 0
    for i in range(n-1):
        diff = abs(a[i] - a[i+1])
        max_n = max(diff, max_n)
    # print(k - max_n)
    l_ans = k - max_n

print(min(r_ans, l_ans))

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

diff = 0
total = 0
for i in range(n-1):
    diff = max(abs(a[i] - a[i+1]), diff)
    total += abs(a[i] - a[i+1])
    
diff_tmp = abs(a[n-1] - k) + a[0]
diff = max(diff_tmp, diff)
total += abs(a[n-1] - k) + a[0] - diff

print(total)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

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

if a == 0:
    print(0)
    sys.exit()

ans = 0
while n > 0:
    if n - a <= 0:
        for i in range(a):
            ans += 1
            n -= 1
            if n <= 0: break
    else:
        ans += a
        n -= a
    n -= b
    
print(ans)

Fixed submission:
import sys

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

if a == 0:
    print(0)
    sys.exit()

syou = n // (a+b)
amari = n % (a+b)

if amari <= a:
    print(syou*a + amari)
else:
    print(syou*a + a)

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

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

if a == 0:
    print(0)
    sys.exit()

ans = 0
while n > 0:
    for i in range(a):
        ans += 1
        n -= 1
        if n <= 0: break
    n -= b
    
print(ans)

Fixed submission:
import sys

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

if a == 0:
    print(0)
    sys.exit()

syou = n // (a+b)
amari = n % (a+b)

if amari <= a:
    print(syou*a + amari)
else:
    print(syou*a + a)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
monsters = list(map(int, input().split()))

monsters.sort(reverse=True)

if(len(monsters) > k):
    for i in range(k):
        monsters.pop(i)
        
    total_hp = sum(monsters)
    print(total_hp)
else: print(0)


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

monsters.sort()

total_hp = 0
if(len(monsters) > k):
    for i in range(n-k):
        total_hp += monsters[i]
        
    print(total_hp)
else: print(0)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())

i = max(a, b)
while True:
    if i%a == 0 and i%b == 0:
        print(i)
        break
    else: i += 1


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

def gcd(a, b):
    while b != 0:
        a, b = b, a%b
    return a
    
def lcm(a, b):
    return int(a*b/gcd(a, b))

print(lcm(a, b))

Buggy python submission (verdict: Runtime Error):
import collections
from functools import reduce
from operator import mul

a,b = map(int, input().split())

def prime_factorization(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
    
def my_index(l, x, default=-1):
    if x in l:
        return l.index(x)
    else:
        return default

prime_a = collections.Counter(prime_factorization(a))
prime_b = collections.Counter(prime_factorization(b))

a_keys = list(prime_a.keys())
b_keys = list(prime_b.keys())

ans = []
for a_key in a_keys:
    suffix = my_index(b_keys, a_key)
    if suffix != -1:
        if a_keys[suffix] > b_keys[suffix]:
            ans.append(a_key ** prime_a[a_key])
        else:
            ans.append(a_key ** prime_b[suffix])
    else:
        ans.append(a_key ** prime_a[a_key])

for b_key in b_keys:
    suffix = my_index(a_keys, b_key)
    if suffix == -1: ans.append(b_key ** prime_b[b_key])

print(reduce(mul, ans))

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

def gcd(a, b):
    while b != 0:
        a, b = b, a%b
    return a
    
def lcm(a, b):
    return int(a*b/gcd(a, b))

print(lcm(a, b))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort()

if 1 == len(l):
    if l[0] >= k:
        print(1)
    else:
        print(0)
    exit()
        
suffix = n // 2
if l[suffix] <= k:
    for i in range(suffix, n+1):
        if l[i] >= k:
            min_suffix = i
            print(n - min_suffix)
            exit()
else:
    for i in range(suffix):
        if l[i] >= k:
            min_suffix = i
            print(n - min_suffix)
            exit()
            
print(0)

Fixed submission:
n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
   
for i in range(n):
    if l[i] >= k:
        print(n-i)
        exit()
print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

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

ans = 0
for vi in itertools.permutations(v):
    point = vi[0]
    for j in range(1,n):
        point = (point+vi[j])/2
    ans = max(point, ans)
    
print(ans)

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

v.sort()

tmp = v[0]
for i in range(n-1):
    tmp = (tmp+v[i+1]) / 2
print(tmp)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))

mini = h[0]
for i in range(1,n-1):
    
    if h[i]-1 > mini:
        print("No")
        exit()
    else:
        mini = h[i]
        
if h[n] <= h[n-1]:
    print("No")
    exit()
    
print("Yes")

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

prev = -999
for i in range(n):
    if prev <= h[i]-1: prev = h[i]-1
    elif prev <= h[i]: prev = h[i]
    else:
        print("No")
        exit()

print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = []
for i in range(n): a.append(int(input()))

for i in range(n):
    big = 0
    for j in range(n):
        if j == i: continue
        big = max(big, a[j])
    print(big)

Fixed submission:
n = int(input())

a = []
for i in range(n):
    a.append(int(input()))
rev_a = sorted(a, reverse=True)

for i in range(n):
    if rev_a[0] == a[i]: print(rev_a[1])
    else: print(rev_a[0])
Buggy python submission (verdict: Runtime Error):
s = input()

orgin = set(list(s))

if len(orgin) > 2:
    print("No")
    exit()

a=0
b=0
for i in s:
    if i == origin[0]: a+=1
    elif i == origin[1]: b+=1

if a==2:
    print("Yes")
else:
    print("No")

Fixed submission:
s = input()

origin = list(set(list(s)))

if len(origin) > 2:
    print("No")
    exit()
a=0
b=0
for i in s:
    if i == origin[0]: a+=1
    elif i == origin[1]: b+=1

if a==2:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
y, m, d = map(int, input().split('/'))
print(y, m, def)
if m <= 4:
    print("Heisei")
else:
    print("TBD")

Fixed submission:
y, m, d = map(int, input().split('/'))
if m <= 4:
    print("Heisei")
else:
    print("TBD")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

for i in range(1, 10**9):
    if i % 2 == 0 and i % n == 0: 
        print(i)
        break

Fixed submission:
n = int(input())
if n % 2 != 0:
    print(n*2)
else:
    print(n)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(a,b+1):
    if i < a+k or i > b-k:
        print(i)

Fixed submission:
a, b, k = map(int, input().split())
if b - a < k * 2:
    for i in range(a,b+1):
        print(i)
else:
    ans = []
    for i in range(a,a+k):
        if i < a+k: ans.append(i)
    for i in range(b-k+1, b+1):
        if i > b-k and i not in ans: ans.append(i)
    for i in ans: print(i)
Buggy python submission (verdict: Runtime Error):
m = int(input())

print(24-m+24

Fixed submission:
m = int(input())
 
print(24-m+24)
Buggy python submission (verdict: Runtime Error):
s = input()
if s in '9':
  print('Yes')
 else:
  print('No')

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

Fixed submission:
x, t = map(int, input().split())
if x-t >= 0:
  print(x-t)
else:
  print(0)