Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1

if a.index(0):
    print(0)
    exit()
 
for i in range(n):
    ans *= a[i]
    if ans>10**18:
        print(-1)
        exit()
print(ans)

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

if 0 in a:
    print(0)
    exit()
 
for i in range(n):
    ans = ans * a[i]
    if ans>10**18:
        print(-1)
        exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce

n = int(input())
a = list(map(int, input().split()))
ans = reduce(mul, a)

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

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

if 0 in a:
    print(0)
    exit()
 
for i in range(n):
    ans = ans * a[i]
    if ans>10**18:
        print(-1)
        exit()
print(ans)

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

for i in range(n):
    ans *= a[i]

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

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

if 0 in a:
    print(0)
    exit()
 
for i in range(n):
    ans = ans * a[i]
    if ans>10**18:
        print(-1)
        exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
h = list(map(int, input().split()))

tmp = [1] * n

ab = [map(int, input().split()) for _ in range(M)]
a, b = [list(i) for i in zip(*ab)]

for i in range(m):
    if h[a[i] - 1] > h[b[i] - 1]:
        tmp[b[i] - 1] = 0
    elif h[a[i] - 1] < h[b[i] - 1]:
        tmp[a[i] - 1] = 0
    else:
        tmp[a[i] - 1] = 0
        tmp[b[i] - 1] = 0

print(sum(tmp))

Fixed submission:
n, m = map(int, input().split())
h = [int(i) for i in input().split()]
obs = [True]*n
ab = []

for i in range(m):
    ab.append(input().split())

for j in range(len(ab)):
    if h[int(ab[j][0]) - 1] > h[int(ab[j][1]) - 1]:
        obs[int(ab[j][1]) - 1] = False

    elif h[int(ab[j][1]) - 1] > h[int(ab[j][0]) - 1]:
        obs[int(ab[j][0]) - 1] = False

    elif h[int(ab[j][0]) - 1] == h[int(ab[j][1]) - 1]:
        obs[int(ab[j][0]) - 1] = False
        obs[int(ab[j][1]) - 1] = False

print(obs.count(True))
Buggy python submission (verdict: Time Limit Exceeded):
import time

def floor(y):
    return int(y)

def main():
    a, b, n = map(int, input().split())
    ans = [floor(a*x/b) - a*floor(x/b) for x in range(1, n+1)]
    print(max(ans))

if __name__ == "__main__":
    main()

Fixed submission:
import math
a, b, n = map(int, input().split())
x = min(b-1, n)
print(math.floor(a*(x%b)/b))

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

ans = [math.floor(a*x/b) - a*math.floor(x/b) for x in range(1, n+1)]

print(max(ans))

Fixed submission:
import math
a, b, n = map(int, input().split())
x = min(b-1, n)
print(math.floor(a*(x%b)/b))
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = map(int, input().split())

while True:
    c = c - b
    if c == 0:
        print('Yes')
        exit()
    
    a = a - d
    if a == 0:
        print('No')
        exit()

Fixed submission:
import math

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

tkhs = math.ceil(c/b)
aok = math.ceil(a/d)

if tkhs <= aok:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = map(int, input().split())

while True:
    c = c - b
    if c == 0:
        print('Yes')
        exit()
    
    a = a - d
    if a == 0:
        print('No')
        exit()

Fixed submission:
import math

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

tkhs = math.ceil(c/b)
aok = math.ceil(a/d)

if tkhs <= aok:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
print(float(2*r*3.14))

Fixed submission:
r = int(input())
print(float(2*r*3.14))
Buggy python submission (verdict: Runtime Error):
n = input()

if n.index('7'):
  print('Yes')
else:
  print('No')

Fixed submission:
n = input()

if '7' in n:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
def solve(n, m):
    ans = [-1]*n
    for _ in range(m):
        s, c = map(int, input().split())
        s = s-1
        if ans[s] == c:
            continue
        elif ans[s] == -1:
            ans[s] = c
        else:
            return -1

    if ans[0] == '0':
        if n == 1:
            return '0'
        else:
            ans[0] = '1'
    for i in range(1, n):
        if ans[i] == -1:
            ans[i] = '0'
    return ''.join(ans)

n, m = map(int, input().split())
print(solve(n, m))

Fixed submission:
def solve(n, m):
    ans = [-1] * n
    for _ in range(m):
        s, c = input().split()
        s = int(s) - 1
        if ans[s] == c:
            continue
        elif ans[s] == -1:
            ans[s] = c
        else:
            return -1
 
    if ans[0] == '0':
        if n == 1:
            return '0'
        else:
            return -1
    elif ans[0] == -1:
        if n == 1:
            return '0'
        else:
            ans[0] = '1'
    for i in range(1, n):
        if ans[i] == -1:
            ans[i] = '0'
    return ''.join(ans)
 
 
n, m = list(map(int, input().split()))
print(solve(n, m))

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans = [0] * n

for _ in range(m):
    s, c = map(int, input().split())
    if ans[s-1] == 0:
        ans[s-1] = c
    else:
        if not ans[s-1] == c:
            print(-1)
            exit()
tmp = set(ans)
tmp.remove(0)
if n == 1 and m == 0:
    print(0)
elif not tmp:
    print(-1)
else:
    print(*ans, sep='')

Fixed submission:
def solve(n, m):
    ans = [-1] * n
    for _ in range(m):
        s, c = input().split()
        s = int(s) - 1
        if ans[s] == c:
            continue
        elif ans[s] == -1:
            ans[s] = c
        else:
            return -1
 
    if ans[0] == '0':
        if n == 1:
            return '0'
        else:
            return -1
    elif ans[0] == -1:
        if n == 1:
            return '0'
        else:
            ans[0] = '1'
    for i in range(1, n):
        if ans[i] == -1:
            ans[i] = '0'
    return ''.join(ans)
 
 
n, m = list(map(int, input().split()))
print(solve(n, m))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
count = 0
tmp = p[0]

for i in range(len(p)):
    target = p[i]
    flag = True
    if tmp < target:
        tmp = target
        continue
    for j in range(i):
        if p[i] > p[j]:
            flag = False
            break
    if flag:
        count += 1

print(count)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
ans = 0
min = p[0]

for i in range(len(p)):
    if p[i]<=min:
        min = p[i]
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
count = 0
tmp = p[0]

for i in range(len(p)):
    target = p[i]
    flag = True
    if tmp < target:
        tmp = target
        continue
    for j in range(i):
        ccount += 1
        if p[i] > p[j]:
            flag = False
            break
    if flag:
        count += 1

print(count)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
ans = 0
min = p[0]

for i in range(len(p)):
    if p[i]<=min:
        min = p[i]
        ans += 1

print(ans)

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

for i in range(len(p)):
    target = p[i]
    flag = True
    for j in range(i):
        if p[i] > p[j]:
            flag = False
            break
    if flag:
        count += 1
        
print(count)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
ans = 0
min = p[0]

for i in range(len(p)):
    if p[i]<=min:
        min = p[i]
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
from math import gcd

def lcm(a, b):
    res = a*b / gcd(a, b)
    return res

a, b = map(int, input().split())
ans = int(lcm(a, b))
print(ans)

Fixed submission:
from fractions import gcd

def lcm(a, b):
    res = a*b / gcd(a, b)
    return res

a, b = map(int, input().split())
ans = int(lcm(a, b))
print(ans)

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

def lcm(a, b):
    return a*b / gcd(a, b)

a, b = map(int, input().split())
ans = int(lcm(a, b))
print(ans)

Fixed submission:
from fractions import gcd

def lcm(a, b):
    res = a*b / gcd(a, b)
    return res

a, b = map(int, input().split())
ans = int(lcm(a, b))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = []

for i in range(1, n+1):
    ans.append(a.index(i)+1)

print(*ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n

for i in range(n):
    ans[a[i]-1] = i+1

print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(input().split())
ans = []

for i in range(1, n+1):
    ans.append(a.index(str(i))+1)

print(*ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n

for i in range(n):
    ans[a[i]-1] = i+1

print(*ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
from math import factorial
n = int(input())
s = [''.join(sorted(list(input()))) for _ in range(n)]

def combination(i):
    return factorial(i) // (factorial(i-2) * factorial(2))

cnt = Counter(s)
print(cnt)
ans = 0
for i in cnt.values():
    print(i)
    ans += combination(i)

print(ans)

Fixed submission:
from collections import Counter
from math import factorial
n = int(input())
s = [''.join(sorted(list(input()))) for _ in range(n)]

def combination(i):
    return factorial(i) // (factorial(i-2) * factorial(2))

cnt = Counter(s)
ans = 0
for i in cnt.values():
    if i == 1:
        pass
    else:
        ans += combination(i)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = ['']*n
for i in range(n):
    a[i] = int(input())

for i in range(n):
    tmp = a[i]
    a[i] = 0
    print(max(a))
    a[i] = tmp

Fixed submission:
n = int(input())
a = ['']*n
for i in range(n):
    a[i] = int(input())
_a = sorted(a, reverse=1)
a_max = _a[0]
a_second = _a[1]
ans = [a_max] * n

for i in range(n):
    if a[i] == a_max:
        ans[i] = a_second
    else:
        pass

print(*ans, sep='\n')
Buggy python submission (verdict: Runtime Error):
l, r = map(int, input().split())
ans = 2018

if r-l > 2018:
    print(0)
    eixt()
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            ans = min(ans, (i*j)%2019)
    print(ans)

Fixed submission:
l, r = map(int, input().split())
res = 2018

if r-l > 2018:
    print(0)
    exit()
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            res = min(res, (i*j)%2019)
print(res)

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

if r-l > 2018:
    print(0)

ans = 2018
for i in range(l, r):
    for j in range(i+1, r+1):
        ans = min(ans, (i*j)%2019)

print(ans)

Fixed submission:
l, r = map(int, input().split())
res = 2018

if r-l > 2018:
    print(0)
    exit()
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            res = min(res, (i*j)%2019)
print(res)

Buggy python submission (verdict: Runtime Error):
l, r = map(int, input().split())
res = 2018

if r-l > 2018:
    print(0)
    eixt()
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            res = min(res, (i*j)%2019)
print(res)

Fixed submission:
l, r = map(int, input().split())
res = 2018

if r-l > 2018:
    print(0)
    exit()
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            res = min(res, (i*j)%2019)
print(res)
Buggy python submission (verdict: Runtime Error):
s,w=map(int.input().split())
print("unsafe" if w>=s else "safe")


Fixed submission:
s,w=map(int,input().split())
print("unsafe" if w>=s else "safe")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

cnt = 0
p = 1

while p < b:
    p += a - 1
    cnt += 1
    
print(cnt)

Fixed submission:
a=input()
b=input()

cnt=0

for i, j in zip(a, b):
  if i==j:
    cnt+=1
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
s = input()
if s.isuper():
    print("A")
else:
    print("a")


Fixed submission:
s = input()
if s.isupper():
    print("A")
else:
    print("a")
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())
k = Y/2
q = y/4
if q<=X and X <= k:
    print("Yes")
else:
    print("No")


Fixed submission:
X, Y = map(int, input().split())
if Y % 2 == 1:
    print("No")
else:
    k = Y/2
    q = Y/4
    if q <= X and X <= k:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())
k = Y/2
q = y/4
if q<=X and X <= k:
    print("Yes")
else:
    print("No")


Fixed submission:
X, Y = map(int, input().split())
if Y % 2 == 1:
    print("No")
else:
    k = Y/2
    q = Y/4
    if q <= X and X <= k:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
t = A[0]
i = 1
while i < N:
    t *= A[i]
    i += 1
if t <= 1e18:
    print(t)
else:
    print(-1)


Fixed submission:
#import numpy as np
N = int(input())
A = list(map(int, input().split()))
#A = np.array(A)
t = A[0]
for i in range(1,N):
    t *= A[i]
    if int(t) > 1e18:
        for j in range(i,N):
            if A[j] == 0:
                t = 0
        break
if int(t) <= 1e18:
    print(int(t))
else:
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
t = A[0]
for i in range(1, N):
    t *=  A[i]
if t > 1e18:
    print(-1)
else:
    print(t)


Fixed submission:
#import numpy as np
N = int(input())
A = list(map(int, input().split()))
#A = np.array(A)
t = A[0]
for i in range(1,N):
    t *= A[i]
    if int(t) > 1e18:
        for j in range(i,N):
            if A[j] == 0:
                t = 0
        break
if int(t) <= 1e18:
    print(int(t))
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
if t > 1e18:
    print(-1)
else:
    print(np.prod(A))


Fixed submission:
#import numpy as np
N = int(input())
A = list(map(int, input().split()))
#A = np.array(A)
t = A[0]
for i in range(1,N):
    t *= A[i]
    if int(t) > 1e18:
        for j in range(i,N):
            if A[j] == 0:
                t = 0
        break
if int(t) <= 1e18:
    print(int(t))
else:
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
t = A[0]
for i in range(1, len(A)):
    t = t * A[i]
if t > 1e18:
    print(-1)
else:
    print(t)


Fixed submission:
#import numpy as np
N = int(input())
A = list(map(int, input().split()))
#A = np.array(A)
t = A[0]
for i in range(1,N):
    t *= A[i]
    if int(t) > 1e18:
        for j in range(i,N):
            if A[j] == 0:
                t = 0
        break
if int(t) <= 1e18:
    print(int(t))
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
K = input()
S = input()
if len(S) < K:
    print(S)
else:
    print("S[:K]" + "...")


Fixed submission:
K = input()
S = input()
K = int(K)
if len(S) <= K:
    print(S)
else:
    a = S[:K] + "..."
    print(a)
Buggy python submission (verdict: Runtime Error):
a, b = map(float, input().split())
if a < 100000:
    print(int(int(a)*b))
else:
    num = str(int(int(a) * b))
    a = int(a)
    a = str(a)
    a = str(a[-6:])
    a = int(a)
    t = a * b
    t = int(t)
    t = str(t)
    t = "0000000" + t
    print(num[:-3] + t[-4:-1])


Fixed submission:
import numpy as np
import math
A, B, H, M = map(int, input().split())
thetaB = 6 * M
thetaA = 0.5 * (60 * H + M)
Ax = math.sin(math.radians(thetaA)) * A
Ay = math.cos(math.radians(thetaA)) * A
Bx = math.sin(math.radians(thetaB)) * B
By = math.cos(math.radians(thetaB)) * B
AA = np.array([Ax,Ay])
BB = np.array([Bx,By])
print(np.linalg.norm(AA-BB))
Buggy python submission (verdict: Runtime Error):
vN, M = map(int, input().split())
s = [-1]
c = [-1]
OK = True
x = 0
for i in range(M):
    s_, c_ = map(int, input().split())
    if N != 1 and s_ == 1 and c_ == 0:
        OK = False
    ok = True
    for i in range(len(s)):
        if s[i] == s_:
            ok = False
            if c[i] != c_:
                OK = False
                break
            break
    if ok:
        s.append(s_)
        c.append(c_)
        x += (10 ** (N - s_)) * c_

if N != 1 and x < 10 ** (N - 1):
    x += 10 ** (N - 1)

if OK:
    print(x)
else:
    print(-1)


Fixed submission:
N, M = map(int, input().split())
s = [-1]
c = [-1]
OK = True
x = 0
for i in range(M):
    s_, c_ = map(int, input().split())
    if N != 1 and s_ == 1 and c_ == 0:
        OK = False
    ok = True
    for i in range(len(s)):
        if s[i] == s_:
            ok = False
            if c[i] != c_:
                OK = False
                break
            break
    if ok:
        s.append(s_)
        c.append(c_)
        x += (10 ** (N - s_)) * c_

if N != 1 and x < 10 ** (N - 1):
    x += 10 ** (N - 1)

if OK:
    print(x)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
import numpy as np
def so(n):
    for i in range(3, int(np.sqrt(n)) + 1, 2):
        if n % i == 0:
            return False
    return True
A, B = map(int, input().split())
M = np.min([A, B])
n = 1
if (A % 2 == 0) and (B % 2 == 0):
    n = 2
for i in range(3, M, 2):
    if so(i):
        if (A % i == 0) and (B % i == 0):
            n = n + 1
print(n)


Fixed submission:
N = int(input())
K = int(N / 2) + N % 2
print(K / N)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
A = list(map(int, input().split()))
T = [0] * N
for i in range(N):
    t = np.argmin(A)
    T[i] = t + 1
    A[t] = N + 1
print(*T)


Fixed submission:
import numpy as np

N = int(input())
A = list(map(int, input().split()))
T = [0] * N
for i in range(N):
    T[A[i]-1] = i + 1 
print(*T)
Buggy python submission (verdict: Runtime Error):
def f(si, sj):
    for i in range(10):
        if si.count(sj[i]) != sj.count(sj[i]):
            return 0
    return 1
n = int(input())
s = [input() for i in range(n)]
x = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        x = x + f(s[i], s[j])
print(x)


Fixed submission:
import numpy as np

a, b = map(int, input().split())
print(np.max([a + b, a - b, a * b]))
Buggy python submission (verdict: Runtime Error):
from sys import stdin

nn = input()

N=int(nn)

arr=list(map(int,input().split()))


if 0 in arr:
    print(0)
    exit()

res=1
for i in arr:
    res*=i
    if res>1000000000000000000:
        print(-1)
        exit();

print(res)

Fixed submission:
from sys import stdin

nn = input()

N=int(nn)

arr=list(map(int,input().split()))


if 0 in arr:
    print(0)
    exit()

res=1
for i in arr:
    res*=i
    if res>1000000000000000000:
        print(-1)
        exit();

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
B = []
C = []
ans = []
for i in range(Q):
    b,q=map(int,input().split())
    B.append(b)
    C.append(q)

for i in range(Q):
    A = [C[i] if j == B[i] else j for j in A]
    print(sum(A))




Fixed submission:
N = int(input())
A = list(map(int,input().split()))
dic = {}
for i in A:
    if i in dic:
        dic[i] = dic[i]+1
    else :
        dic[i] = 1
s = sum(A)

Q = int(input())
B=[]
C=[]
for i in range(Q):
    b,c=map(int,input().split())
    B.append(b)
    C.append(c)

for b,c in zip(B,C):
    if b in dic:
        temp = dic[b]
        s = s + (c-b)*temp
        del dic[b]
        if c in dic:
            dic[c] = dic[c]+temp
        else :
            dic[c] = temp
    print(s)
Buggy python submission (verdict: Runtime Error):
A,B = input().split()

print(A*B)

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

print(A*B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

ans = 1
for i in A:
  ans = ans * i
 
if ans > 1e18:
  print(-1)
else:
  print(ans)

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

ans = 1

if 0 in A:
    print(0)
    exit()

for i in A:
    ans = ans * i
    if ans > 1e18:
        print(-1)
        exit()

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

if 13 <= A:
    print(B)
elif 6 <= A:
    print(int(B/2))
else :
    print(0

Fixed submission:
A,B = map(int,input().split())
 
if 13 <= A:
    print(B)
elif 6 <= A:
    print(int(B/2))
else :
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
L = [0] * M
R = [0] * M
for i in range (0,M):
    L[i],R[i] = map(int,input().split())

S = [set(range(L[i],R[i]+1)) for i in range(0,M)]

temp = S[0]

for i in range(1,M):
    temp = temp & S[i]

print(len(temp))

Fixed submission:
N,M = map(int,input().split())
L = [0] * M
R = [0] * M
for i in range (0,M):
    L[i],R[i] = map(int,input().split())

print(len(range(max(L),min(R)+1)))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
L = [0] * M
R = [0] * M
for i in range (0,M):
    L[i],R[i] = map(int,input().split())

S = [set(range(L[i],R[i]+1)) for i in range(0,M)]

temp = S[0]

for i in range(1,M):
    temp = temp & S[i]

print(len(temp))

Fixed submission:
N,M = map(int,input().split())
L = [0] * M
R = [0] * M
for i in range (0,M):
    L[i],R[i] = map(int,input().split())

print(len(range(max(L),min(R)+1)))
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
S = list(input())

S[K-1] = S[K-1].lower()

print("".join(S)

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

S[K-1] = S[K-1].lower()

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


print(sum([(1/N)*(0.5)**math.ceil(math.log2(math.ceil(K/i))) if i<K else 1/N for i in range(1,N+1)])

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


print('{:.12f}'.format(sum([(1/N)*(0.5)**math.ceil(math.log2(math.ceil(K/i))) if i<K else 1/N for i in range(1,N+1)])))

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


print(sum([(1/N)*(0.5)**math.ceil(math.log2(max(K//i,1))) for i in range(1,N+1)])

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


print('{:.12f}'.format(sum([(1/N)*(0.5)**math.ceil(math.log2(math.ceil(K/i))) if i<K else 1/N for i in range(1,N+1)])))

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


print(sum([(1/N)*(0.5)**math.ceil(math.log2(max(K//i,1))) for i in range(1,N+1)])

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


print('{:.12f}'.format(sum([(1/N)*(0.5)**math.ceil(math.log2(math.ceil(K/i))) if i<K else 1/N for i in range(1,N+1)])))