Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split())) 
a = tuple(a)
if a.count(1) == 0:
    print(-1)
else:
    y = n
    s = 0
    for i in range(1, n+1):
        if a[s:].count(i) == 0:
            y = i-1
            break
        else:
            s = a[s:].index(i)+1
    print(n-y)

Fixed submission:
n = int(input())
a = list(map(int, input().split())) 
a = tuple(a)
if a.count(1) == 0:
    print(-1)
else:
    s = 0
    t = 1
    for i in range(n):
        if a[i] == t:
            t += 1
        else: s += 1
    print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split())) 
a = tuple(a)
if a.count(1) == 0:
    print(-1)
else:
    y = n
    for i in range(1, n+1):
        if a.count(i) == 0:
            y = i-1
            break
        else:
            s = a.index(i)
            a = a[s+1:]
    print(n-y)

Fixed submission:
n = int(input())
a = list(map(int, input().split())) 
a = tuple(a)
if a.count(1) == 0:
    print(-1)
else:
    s = 0
    t = 1
    for i in range(n):
        if a[i] == t:
            t += 1
        else: s += 1
    print(s)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split())) 
if a.count(1) == 0:
    print(-1)
else:
    t = 0
    for i in range(1, n):
        if not a.count(i) == 0:
            s = a.index(i)
            for j in range(t, s+1):
                a[j] = 0
            t = s
        else:
            y = i-1
            break
    print(n-y)

Fixed submission:
n = int(input())
a = list(map(int, input().split())) 
a = tuple(a)
if a.count(1) == 0:
    print(-1)
else:
    s = 0
    t = 1
    for i in range(n):
        if a[i] == t:
            t += 1
        else: s += 1
    print(s)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split())) 
if a.count(1) == 0:
    print(-1)
else: 
    for i in range(1, n):
        if not a.count(i) == 0:
            del a[:a.index(i)]
        else:
            y = i-1
            break
    print(n-y)

Fixed submission:
n = int(input())
a = list(map(int, input().split())) 
a = tuple(a)
if a.count(1) == 0:
    print(-1)
else:
    s = 0
    t = 1
    for i in range(n):
        if a[i] == t:
            t += 1
        else: s += 1
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 0
t = 0
u = 0
m = max(A)
for i in range(60):
    if m >= 2**i:
        u += 1
    else: break
for i in range(u):
    for j in range(N):
        if A[j]%(2**(i+1)) >= 2 ** i:
            t += 1
    ans += (t * (N-t)) * 2**i
    t = 0
print(ans%1000000007) 

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
t = 0
u = 0
m = max(A)
for i in range(60):
    if m >= 2**i:
        u += 1
    else: break
for i in range(u):
    for j in range(N):
        t += (A[j] >> i) & 1
    ans += (t * (N-t)) * 2**i
    t = 0
print(ans%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 0
t = 0
u = 0
for i in range(60):
    if max(A) >= 2**i:
        u += 1
    else: break
for i in range(u):
    for j in range(N):
        if A[j] >= 2 ** i:
            t += ((A[j]%(2**(i+1)))//(2**i))
    ans += (t * (N-t)) * 2**i
    t = 0
print(ans%1000000007) 

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
t = 0
u = 0
m = max(A)
for i in range(60):
    if m >= 2**i:
        u += 1
    else: break
for i in range(u):
    for j in range(N):
        t += (A[j] >> i) & 1
    ans += (t * (N-t)) * 2**i
    t = 0
print(ans%1000000007)
Buggy python submission (verdict: Runtime Error):
n = input()
l = len(n)
y = 0
for i in range(1, l, 2):
  y += 9 * 10 ** (i-1)
if l % 2 == 1:
  y += int(n) - int('9'*(l-1))
print(y)

Fixed submission:
n = input()
l = len(n)
y = 0
if l >= 2:
    for i in range(1, l, 2):
        y += 9 * 10 ** (i-1)
    if l % 2 == 1:
        y += int(n) - int('9'*(l-1))
else: y = int(n)
print(y)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
a1 = a.sorted()
st = a1[-1]
nd = a1[-2]
for i in a:
  if i = st:
    print(nd)
  else: print(st)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
a1 = sorted(a)
st = a1[-1]
nd = a1[-2]
for i in a:
  if i == st:
    print(nd)
  else: print(st)
Buggy python submission (verdict: Runtime Error):
from math import factorial

def comb(a,b):
    return factorial(a) // factorial(b) // factorial(a-b)

n, k = map(int, input().split())
for i in range(k):
    print(comb(k-1, i) * comb(n-k+1, i+1) % 1000000007)

Fixed submission:
from math import factorial

def comb(a,b):
    return factorial(a) // factorial(b) // factorial(abs(a-b))

n, k = map(int, input().split())
for i in range(k):
    print(comb(k-1, i) * comb(n-k+1, i+1) % 1000000007)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
if n % 2 == 0:
    for i in range(n//2):
        if not a.count(2*i+1) == 2:
            print(0)
            break
    else: print(2**(n//2) % 1000000007)
else:
    for i in range(1,n//2+1):
        if not a.count(2*i) == 2:
            print(0)
            break
    else:
        if a.count(0) == 1:
            print(2**(n//2) % 1000000007)
        else: print(0)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
if n % 2 == 1:
    if a[0] != 0:
        print(0)
    else:
        for i in range(2, n, 2):
            if not i == a[i-1] == a[i]:
                print(0)
                break
        else: print((2**(n//2))%1000000007)
else:
    for i in range(1, n, 2):
        if not i == a[i-1] == a[i]:
            print(0)
            break
    else: print((2**(n//2))%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
if n % 2 == 0:
    for i in range(n//2):
        if not a.count(2*i+1) == 2:
            print(0)
            break
    else: print(2**(n//2))
else:
    for i in range(1,n//2+1):
        if not a.count(2*i) == 2:
            print(0)
            break
    else:
        if a.count(0) == 1:
            print(2**(n//2))
        else: print(0)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
if n % 2 == 1:
    if a[0] != 0:
        print(0)
    else:
        for i in range(2, n, 2):
            if not i == a[i-1] == a[i]:
                print(0)
                break
        else: print((2**(n//2))%1000000007)
else:
    for i in range(1, n, 2):
        if not i == a[i-1] == a[i]:
            print(0)
            break
    else: print((2**(n//2))%1000000007)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
B = {}
C = {}
for a in A:
    if a in C:
        continue
    c = A.count(a)
    C[a] = c
    B[a] = c * (c - 1) / 2

s = int(sum(B.values()))
for a in A:
    print(int(s - C[a] + 1))

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
C = {}
for a in A:
    if a in C:
        C[a] += 1
    else:
        C[a] = 1

s = int(sum(c * (c - 1) / 2 for c in C.values()))
for a in A:
    print(int(s - C[a] + 1))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
B = {}
C = {}
for a in A:
    c = A.count(a)
    C[a] = c
    B[a] = c * (c - 1) / 2

s = int(sum(B.values()))
for a in A:
    print(int(s - (C[a] * (C[a] - 1) / 2) + ((C[a] - 2) * (C[a] - 1) / 2)))


Fixed submission:
n = int(input())
A = list(map(int, input().split()))
C = {}
for a in A:
    if a in C:
        C[a] += 1
    else:
        C[a] = 1

s = int(sum(c * (c - 1) / 2 for c in C.values()))
for a in A:
    print(int(s - C[a] + 1))
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input())
print(max(a-b*2,0))

Fixed submission:
a, b = map(int, input().split())
print(max(a-b*2, 0))
Buggy python submission (verdict: Runtime Error):
S = input()[::-1]
MOD = 10**9+7
dp = (1,0,0,0,0,0,0,0,0,0,0,0,0)
p = 1
for i, s in enumerate(S):
    nx = [0,]*13
    if s == '?':
        for k in range(10):
            q = (k*p)%13
            for j, d in enumerate(dp):
                nx[(j+q)%13] += d
    else:
        q = (int(s)*p)%13
        for j, d in enumerate(dp):
            nx[(j+q)%13] += d
    dp = (n % MOD for n in nx)
    p = (10*p)%13
print(dp[5])

Fixed submission:
A, B = map(int, input().split())
if (A + B) % 2 == 0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
r = 0
for i in range(n):
    p, x = 0, 0
    for j in range(i, n):
        p += A[j]
        x ^= A[j]
        if p == x:
            r += 1
        else:
            break
print(r)

Fixed submission:
a, b = map(int, input().split())
print(max(a+b, a-b, a*b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
m = n
for i in range(n):
    x = s[:i]
    y = s[i+1:]
    m = min(m, x.count('W')+y.count('E'))
print(m)


Fixed submission:
n = int(input())
s = input()
a, e = 0, s.count("E")
for c in s:
    if c == 'W':
        n = min(n, a+e)
        a += 1
    else:
        e -= 1
        n = min(n, a+e)
print(n)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
r = 0
for i in range(n):
    p = 0
    for j in range(i, n):
        if p & A[j] == 0:
            r += 1
            p ^= A[j]
        else:
            break
print(r)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
ans = 0
s = 0
j = 0
for i in range(n):
    while j < n and not (s & A[j]):
        s ^= A[j]
        j += 1
    ans += j-i
    s ^= A[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
r = 0
for i in range(n):
    p, x = 0, 0
    for j in range(i, n):
        p += A[j]
        x ^= A[j]
        if p == x:
            r += 1
        else:
            break
print(r)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
ans = 0
s = 0
j = 0
for i in range(n):
    while j < n and not (s & A[j]):
        s ^= A[j]
        j += 1
    ans += j-i
    s ^= A[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
r = 0
for i in range(n):
    p, x = 0, 0
    for j in range(n-i):
        p += A[i+j]
        x ^= A[i+j]
        if p == x:
            r += 1
print(r)


Fixed submission:
n = int(input())
A = list(map(int, input().split()))
ans = 0
s = 0
j = 0
for i in range(n):
    while j < n and not (s & A[j]):
        s ^= A[j]
        j += 1
    ans += j-i
    s ^= A[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from math import sqrt
from itertools import combinations
import random
n = int(input())


def primes(x):
    if x < 2:
        return []
    primes = [i for i in range(x)]
    primes[1] = 0
    for prime in primes:
        if prime > sqrt(x):
            break
        if prime == 0:
            continue
        for non_prime in range(2 * prime, x, prime):
            primes[non_prime] = 0
    return [prime for prime in primes if prime != 0]


p = primes(55555)
ans = p[1:n]
k = 0
while True:
    comb = combinations(ans, 5)
    for c in comb:
        if sum(c) in p:
            ans[ans.index(min(c))] = p[n+k]
            k += 1
            break
    else:
        break
print('2 '+' '.join(map(str, ans)))

Fixed submission:
print(' '.join(map(str, [11, 31, 41, 61, 71, 101, 131, 151, 181, 191, 211, 241, 251, 271, 281, 311, 331, 401, 421, 431, 461, 491, 521, 541, 571, 601, 631, 641, 661, 691, 701, 751, 761, 811, 821, 881, 911, 941, 971, 991, 1021, 1031, 1051, 1061, 1091, 1151, 1171, 1181, 1201, 1231, 1291, 1301, 1321, 1361, 1381][:int(input())])))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
for _ in range(N):
    S.append(input())

setS = set(S)
C = {s:S.count(s) for s in setS}
M = max(C.values())

R = [s for s in setS if C[s]==M]
R.sort()

for r in R:
    print(r)



Fixed submission:
N = int(input())
S = []
for _ in range(N):
    S.append(input())

import collections    
C = collections.Counter(S)
M = C.most_common()[0][1]
R = [c for c in C.keys() if C[c]==M]
R.sort()

for r in R:
    print(r)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
for _ in range(N):
    S.append(input())

M = max([S.count(s) for s in set(S)])

R = [s for s in set(S) if S.count(s)==M]
R.sort()

for r in R:
    print(r)

Fixed submission:
N = int(input())
S = []
for _ in range(N):
    S.append(input())

import collections    
C = collections.Counter(S)
M = C.most_common()[0][1]
R = [c for c in C.keys() if C[c]==M]
R.sort()

for r in R:
    print(r)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
P = list(map(int, input().split()))

M = [(1+p)/2 for p in P]
result = 0

for i in range(N-K+1):
    tmp = sum(M[i:i+K])
    if result<tmp:
        result=tmp

print(result)

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

M = [(1+p)/2 for p in P]
result = [0, ]

for i in range(1, N-K+1):
    result.append(result[-1] + M[i+K-1] - M[i-1])

print(sum(M[:K]) + max(result))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
ahs = list(map(lambda x:int(x)//2, input().split()))

from fractions import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(ahs)

result = True
for ah in ahs:
    if (lcm // ah) % 2 == 0:
        result = False
        break

if result == False:
    print(0)
else:
    print((M//lcm-1)//2 + 1)

Fixed submission:
N, M = list(map(int, input().split()))
ahs = list(map(lambda x:int(x)//2, input().split()))

odd = sum([ah % 2 for ah in ahs])
if odd!=0 and N-odd!=0:
    print(0)
else:
    from fractions import gcd
    from functools import reduce

    def lcm_base(x, y):
        return (x * y) // gcd(x, y)

    def lcm_list(numbers):
        return reduce(lcm_base, numbers, 1)

    lcm = lcm_list(ahs)

    result = True
    for ah in ahs:
        if (lcm // ah) % 2 == 0:
            result = False
            break

    if result == False:
        print(0)
    else:
        print((M//lcm-1)//2 + 1)

Buggy python submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
ahs = list(map(lambda x:int(x)//2, input().split()))

from fraction import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(ahs)

result = True
for ah in ahs:
    if (lcm // ah) % 2 == 0:
        result = False
        break

if result == False:
    print(0)
else:
    print((M//lcm-1)//2 + 1)

Fixed submission:
N, M = list(map(int, input().split()))
ahs = list(map(lambda x:int(x)//2, input().split()))

odd = sum([ah % 2 for ah in ahs])
if odd!=0 and N-odd!=0:
    print(0)
else:
    from fractions import gcd
    from functools import reduce

    def lcm_base(x, y):
        return (x * y) // gcd(x, y)

    def lcm_list(numbers):
        return reduce(lcm_base, numbers, 1)

    lcm = lcm_list(ahs)

    result = True
    for ah in ahs:
        if (lcm // ah) % 2 == 0:
            result = False
            break

    if result == False:
        print(0)
    else:
        print((M//lcm-1)//2 + 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S, T = input().split()

result = []
for s, t in S, T:
    result.append(s)
    result.append(t)
    
print(''.join(result))

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

result = []
for s, t in zip(S, T):
    result.append(s)
    result.append(t)
    
print(''.join(result))
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, input().split()))

import math

print(int(A * B // math.gcd(A, B)))

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

_A, _B = min(A, B), max(A, B)

pres = _A
while True:
    res = _B % _A
    if res == 0:
        break
    else:
        pres = res
        _B = _A
        _A = res

print((A * B) // pres)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
print(sum(range(N)))

Fixed submission:
N = int(input())

print((0+N-1)*(N)//2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
chars = 'abcdefghijklmnopqrstuvwxyz'

for i in range(N):
    s = input()
    S.append(int(''.join([str(s.count(a)) for a in chars])))

count = 0
for i in range(N-1):
    for j in range(i+1, N):
        count += 1 if S[i]==S[j] else 0

print(count)

Fixed submission:
N = int(input())
S = []

for i in range(N):
    s = input()
    S.append(''.join(sorted(s)))

S.sort()
count = 0
sw = 0
series = []
for i in range(1, len(S)):
    if S[i-1]==S[i]:
        sw = 1
        count += 1
    else:
        if sw==1:
            count += 1
            series.append(count)
            count = 0
            sw = 0
if sw==1:
    count += 1
series.append(count)

count = int(sum([c * (c-1)/2 for c in series]))

print(count)

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

N = int(input())
S = []
for i in range(N):
    S.append(collections.Counter(input()))

count = 0
for i in range(N-1):
    for j in range(i+1, N):
        count += 1 if S[i]==S[j] else 0

print(count)

Fixed submission:
N = int(input())
S = []

for i in range(N):
    s = input()
    S.append(''.join(sorted(s)))

S.sort()
count = 0
sw = 0
series = []
for i in range(1, len(S)):
    if S[i-1]==S[i]:
        sw = 1
        count += 1
    else:
        if sw==1:
            count += 1
            series.append(count)
            count = 0
            sw = 0
if sw==1:
    count += 1
series.append(count)

count = int(sum([c * (c-1)/2 for c in series]))

print(count)
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())

import numpy as np
ms = np.array(np.unique(np.arange(L, R+1) % 2019))

Ms = ms.reshape(-1,1)*ms.reshape(1,-1)
Ms = Ms % 2019
Ms += np.eye(Ms.shape[0], dtype=int)*2019
print(np.min(Ms))

Fixed submission:
L, R = map(int, input().split())

import numpy as np
if L+2019<=R:
    ms = np.arange(2019)
else:
    ms = np.unique(np.arange(L, R+1) % 2019)

Ms = ms.reshape(-1,1)*ms.reshape(1,-1)
Ms = Ms % 2019
Ms += np.eye(Ms.shape[0], dtype=int)*2019
print(np.min(Ms))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
D = list(map(int, input().split()))

rates = sorted(list(set(D)))
counter = [0] * len(rates)
for i in range(len(rates)):
    counter[i] += D.count(rates[i])

acc = 0
found = False
for i in range(len(counter)):
    acc += counter[i]
    if acc == N/2:
        found = True
        break
    if acc > N/2:
        found = False
        break

if found == False:
    print(0)
else:
    print(rates[i+1]-rates[i])

Fixed submission:
import collections

N = int(input())
D = list(map(int, input().split()))

c = collections.Counter(D)
c = sorted(c.items(), key=lambda x:x[0])

rates, counter = list(zip(*c))

acc = 0
found = False
for i in range(len(counter)):
    acc += counter[i]
    if acc == N/2:
        found = True
        break
    if acc > N/2:
        found = False
        break

if found == False:
    print(0)
else:
    print(rates[i+1]-rates[i])

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

rates = sorted(list(set(D)))
counter = [0] * len(rates)
for d in D:
    counter[rates.index(d)]+=1

acc = 0
found = False
for i in range(len(counter)):
    acc += counter[i]
    if acc == N/2:
        found = True
        break
    if acc > N/2:
        found = False
        break

if found == False:
    print(0)
else:
    print(rates[i+1]-rates[i])

Fixed submission:
import collections

N = int(input())
D = list(map(int, input().split()))

c = collections.Counter(D)
c = sorted(c.items(), key=lambda x:x[0])

rates, counter = list(zip(*c))

acc = 0
found = False
for i in range(len(counter)):
    acc += counter[i]
    if acc == N/2:
        found = True
        break
    if acc > N/2:
        found = False
        break

if found == False:
    print(0)
else:
    print(rates[i+1]-rates[i])
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

import math
CD = C * D // math.gcd(C, D)

# C, D, C*Dで割り切れるものの個数
div_C = B//C - (A//C + (-1 if A%C==0 else 0))  # 40//6 - 10//6 -> 6 - 1 = 5
div_D = B//D - (A//D + (-1 if A%D==0 else 0))  # 40//8 - 10//8 -> 5 - 1 = 4
div_CD = B//(CD) - max(0, (A//(CD) + (-1 if A%(CD)==0 else 0)))
print(B-A+1 - div_C - div_D + div_CD)

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

import fractions
CD = C * D // fractions.gcd(C, D)

# C, D, C*Dで割り切れるものの個数
div_C = B//C - (A//C + (-1 if A%C==0 else 0))  # 40//6 - 10//6 -> 6 - 1 = 5
div_D = B//D - (A//D + (-1 if A%D==0 else 0))  # 40//8 - 10//8 -> 5 - 1 = 4
div_CD = B//(CD) - max(0, (A//(CD) + (-1 if A%(CD)==0 else 0)))
print(B-A+1 - div_C - div_D + div_CD)
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
Ls = map(int, input().split())

count = 0
position = 0
for i in range(N):
    if X<position:
        break
    else:
        count += 1
        position += Ls[i]

print(count)

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

count = 0
position = 0
for i in range(N):
    if X<position:
        break
    else:
        count += 1
        position += Ls[i]

if X<position:
    pass
else:
    count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
N ,K = map(int, input().split())
S = input()

s=list(S)
if s[K]=="A":
    s[K]='a'
elif s[K]=='B':
    s[K]='b'
elif s[K]=='C':
    s[K]='c'
print(s)

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

K -= 1

s=list(S)
if s[K]=="A":
    s[K]='a'
elif s[K]=='B':
    s[K]='b'
elif s[K]=='C':
    s[K]='c'

print(''.join(s))

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

s=list(S)
if s[K]=="A":
    s[K]='a'
elif s[K]=='B':
    s[K]='b'
elif s[K]=='C':
    s[K]='c'
print(s)

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

K -= 1

s=list(S)
if s[K]=="A":
    s[K]='a'
elif s[K]=='B':
    s[K]='b'
elif s[K]=='C':
    s[K]='c'

print(''.join(s))
Buggy python submission (verdict: Runtime Error):
S = list(input())

s_1 = int(S[0:1])
s_2 = int(S[2:])

YYMM = False
MMYY = False

if 1<=s_2<=12:
    YYMM = True
if 1<=s_1<=12:
    MMYY = True
    
if YYMM and MMYY:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')
else:
    print('NA')

Fixed submission:
S = input()

s_1 = int(S[0:2])
s_2 = int(S[2:])

YYMM = False
MMYY = False

if 1<=s_2<=12:
    YYMM = True
if 1<=s_1<=12:
    MMYY = True
    
if YYMM and MMYY:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')
else:
    print('NA')
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input())
# N ,K = 100000, 5

def min_v(x, k):
    v=1.0
    while v>x/k:
        v /= 2
    return v

V = 0
for n in range(1, N+1):
    V += min_v(n, K)

print('{:.16f}'.format(V/N))

Fixed submission:
N, K = map(int, input().split())
# N ,K = 100000, 5

def min_v(x, k):
    v=1.0
    while v>x/k:
        v /= 2
    return v

V = 0
for n in range(1, N+1):
    V += min_v(n, K)

print('{:.16f}'.format(V/N))